TFrame3

[TFrame3](API\Plugins\GeometricObjects\TFrame3) is an object that represents an oriented 3D coordinate frame, ie orthogonal X/Y/Z axes at a point in space.

Windows
MacOS
Linux

References

Module

GeometricObjects

Header

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

Include

#include "FrameTypes.h"

Syntax

template<typename RealType>
struct TFrame3

Remarks

TFrame3 is an object that represents an oriented 3D coordinate frame, ie orthogonal X/Y/Z axes at a point in space. One can think of this Frame as a local coordinate space measured along these axes. Functions are provided to map geometric objects to/from the Frame coordinate space.

Internally the representation is the same as an FTransform, except a Frame has no Scale.

Variables

Name Description

Public variable

FVector3< RealT...

 

Origin

Origin of the frame

Public variable

TQuaternion< Re...

 

Rotation

Rotation of the frame. Think of this as the rotation of the unit X/Y/Z axes to the 3D frame axes.

Constructors

Name Description

Public function

TFrame3()

Construct a frame positioned at (0,0,0) aligned to the unit axes

Public function

TFrame3

(
    const FVector3< RealType >& Origin...
)

Construct a frame at the given Origin aligned to the unit axes

Public function

TFrame3

(
    const FTransform& Transform
)

Construct a Frame from an FTransform

Public function

TFrame3

(
    const FPlane& Plane
)

Construct a Frame from an FPlane

Public function

TFrame3

(
    const TFrame3< RealType2 >& OtherF...
)

Convert between TFrame of different types

Public function

TFrame3

(
    const FVector3< RealType >& Origin...,
    const TQuaternion< RealType > Rotat...
)

Construct a Frame from the given Origin and Rotation

Public function

TFrame3

(
    const FVector3< RealType >& Origin...,
    const FVector3< RealType >& SetZ
)

Construct a frame with the Z axis aligned to a target axis

Public function

TFrame3

(
    const FVector& OriginIn,
    const FQuat& RotationIn
)

Construct a Frame from an FVector and FQuat

Public function

TFrame3

(
    const FVector3< RealType >& Origin...,
    const FVector3< RealType >& X,
    const FVector3< RealType >& Y,
    const FVector3< RealType >& Z
)

Construct Frame from X/Y/Z axis vectors. Vectors must be mutually orthogonal.

Functions

Name Description

Public function

void

 

AlignAxis

(
    int AxisIndex,
    const FVector3< RealType >& ToDire...
)

Align an axis of this frame with a target direction

Public function

void

 

ConstrainedAlignAxis

(
    int AxisIndex,
    const FVector3< RealType >& ToDire...,
    const FVector3< RealType >& Around...
)

Compute rotation around vector that best-aligns axis of frame with target direction

Public function

void

 

ConstrainedAlignPerpAxes

(
    int PerpAxis1,
    int PerpAxis2,
    int NormalAxis,
    const FVector3< RealType >& UpAxis,
    const FVector3< RealType >& Fallba...,
    RealType UpDotTolerance
)

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.

Public function Const

TFrame3< Rea...

 

FromFrame

(
    const TFrame3< RealType >& Frame
)

Public function Const

TQuaternion<...

 

FromFrame

(
    const TQuaternion< RealType >& Qua...
)

Public function Const

TRay3< RealT...

 

FromFrame

(
    const TRay3< RealType >& Ray
)

Public function Const

FVector3< Re...

 

FromFramePoint

(
    const FVector3< RealType >& Point
)

Public function Const

FVector3< Re...

 

FromFrameVector

(
    const FVector3< RealType >& Vector
)

Public function Const

FVector3< Re...

 

FromPlaneUV

(
    const FVector2< RealType >& PosUV,
    int PlaneNormalAxis
)

Map a point from local UV plane coordinates to the corresponding 3D point in one of the planes of the frame

Public function Const

void

 

GetAxes

(
    FVector3< RealType >& X,
    FVector3< RealType >& Y,
    FVector3< RealType >& Z
)

Public function Const

FVector3< Re...

 

GetAxis

(
    int AxisIndex
)

Public function Const

FVector3< Re...

 

PointAt

(
    RealType X,
    RealType Y,
    RealType Z
)

Public function Const

FVector3< Re...

 

PointAt

(
    const FVector3< RealType >& Point
)

Public function Const

bool

 

RayPlaneIntersection

(
    const FVector3< RealType >& RayOri...,
    const FVector3< RealType >& RayDir...,
    int PlaneNormalAxis,
    FVector3< RealType >& HitPointOut
)

Compute intersection of ray with plane defined by frame origin and axis as normal

Public function

void

 

Rotate

(
    const TQuaternion< RealType >& Qua...
)

Rotate this frame by given quaternion

Public function Const

FPlane

 

ToFPlane()

Public function Const

TRay3< RealT...

 

ToFrame

(
    const TRay3< RealType >& Ray
)

Public function Const

TFrame3< Rea...

 

ToFrame

(
    const TFrame3< RealType >& Frame
)

Public function Const

TQuaternion<...

 

ToFrame

(
    const TQuaternion< RealType >& Qua...
)

Public function Const

FVector3< Re...

 

ToFramePoint

(
    const FVector3< RealType >& Point
)

Public function Const

FVector3< Re...

 

ToFrameVector

(
    const FVector3< RealType >& Vector
)

Public function Const

FTransform

 

ToFTransform()

Public function Const

FVector3< Re...

 

ToPlane

(
    const FVector3< RealType >& Pos,
    int PlaneNormalAxis
)

Project a point onto one of the planes of the frame

Public function Const

FVector2< Re...

 

ToPlaneUV

(
    const FVector3< RealType >& Pos,
    int PlaneNormalAxis
)

Project 3D point into plane and convert to UV coordinates in that plane

Public function Const

TTransform3<...

 

ToTransform()

Public function

void

 

Transform

(
    const TTransform3< RealType >& XFo...
)

Transform this frame by the given transform

Public function

void

 

Transform

(
    const FTransform& XForm
)

Transform this frame by the given transform

Public function Const

FVector3< Re...

 

X()

Public function Const

FVector3< Re...

 

Y()

Public function Const

FVector3< Re...

 

Z()

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