UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
UE::Geometry::TFrame3< RealType > Struct Template Reference

#include <FrameTypes.h>

Public Member Functions

 TFrame3 ()
 
 TFrame3 (const TVector< RealType > &OriginIn)
 
 TFrame3 (const TVector< RealType > &OriginIn, const TQuaternion< RealType > RotationIn)
 
 TFrame3 (const TVector< RealType > &OriginIn, const TVector< RealType > &SetZ)
 
 TFrame3 (const TVector< RealType > &OriginIn, const TVector< RealType > &X, const TVector< RealType > &Y, const TVector< RealType > &Z)
 
 TFrame3 (const FTransform &Transform)
 
 TFrame3 (const FPlane &Plane)
 
 TFrame3 (const FVector &OriginIn, const FQuat &RotationIn)
 
template<typename RealType2 >
 TFrame3 (const TFrame3< RealType2 > &OtherFrame)
 
TVector< RealType > GetAxis (int AxisIndex) const
 
void GetAxes (TVector< RealType > &X, TVector< RealType > &Y, TVector< RealType > &Z) const
 
TVector< RealType > X () const
 
TVector< RealType > Y () const
 
TVector< RealType > Z () const
 
FTransform ToFTransform () const
 
FTransform ToInverseFTransform () const
 
FPlane ToFPlane () const
 
TTransformSRT3< RealType > ToTransform () const
 
TTransformSRT3< RealType > ToInverseTransform () const
 
TVector< RealType > PointAt (RealType X, RealType Y, RealType Z) const
 
TVector< RealType > PointAt (const TVector< RealType > &Point) const
 
TVector< RealType > ToFramePoint (const TVector< RealType > &Point) const
 
TVector< RealType > FromFramePoint (const TVector< RealType > &Point) const
 
TVector< RealType > ToFrameVector (const TVector< RealType > &Vector) const
 
TVector< RealType > FromFrameVector (const TVector< RealType > &Vector) const
 
TQuaternion< RealType > ToFrame (const TQuaternion< RealType > &Quat) const
 
TQuaternion< RealType > FromFrame (const TQuaternion< RealType > &Quat) const
 
TRay< RealType > ToFrame (const TRay< RealType > &Ray) const
 
TRay< RealType > FromFrame (const TRay< RealType > &Ray) const
 
TFrame3< RealType > ToFrame (const TFrame3< RealType > &Frame) const
 
TFrame3< RealType > FromFrame (const TFrame3< RealType > &Frame) const
 
TVector2< RealType > ToPlaneUV (const TVector< RealType > &Pos, int PlaneNormalAxis=2) const
 
TVector< RealType > FromPlaneUV (const TVector2< RealType > &PosUV, int PlaneNormalAxis=2) const
 
TVector< RealType > ToPlane (const TVector< RealType > &Pos, int PlaneNormalAxis=2) const
 
void Rotate (const TQuaternion< RealType > &Quat)
 
void Transform (const FTransform &XForm)
 
void Transform (const TTransformSRT3< RealType > &XForm)
 
void AlignAxis (int AxisIndex, const TVector< RealType > &ToDirection)
 
void ConstrainedAlignAxis (int AxisIndex, const TVector< RealType > &ToDirection, const TVector< RealType > &AroundVector)
 
void ConstrainedAlignPerpAxes (int PerpAxis1=0, int PerpAxis2=1, int NormalAxis=2, const TVector< RealType > &UpAxis=TVector< RealType >::UnitZ(), const TVector< RealType > &FallbackAxis=TVector< RealType >::UnitX(), RealType UpDotTolerance=(RealType) 0.707)
 
bool RayPlaneIntersection (const TVector< RealType > &RayOrigin, const TVector< RealType > &RayDirection, int PlaneNormalAxis, UE::Math::TVector< RealType > &HitPointOut) const
 

Public Attributes

TVector< RealType > Origin
 
TQuaternion< RealType > Rotation
 

Detailed Description

template<typename RealType>
struct UE::Geometry::TFrame3< RealType >

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.

Constructor & Destructor Documentation

◆ TFrame3() [1/9]

template<typename RealType >
UE::Geometry::TFrame3< RealType >::TFrame3 ( )
inline

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

◆ TFrame3() [2/9]

template<typename RealType >
UE::Geometry::TFrame3< RealType >::TFrame3 ( const TVector< RealType > &  OriginIn)
inlineexplicit

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

◆ TFrame3() [3/9]

template<typename RealType >
UE::Geometry::TFrame3< RealType >::TFrame3 ( const TVector< RealType > &  OriginIn,
const TQuaternion< RealType >  RotationIn 
)
inline

Construct a Frame from the given Origin and Rotation

◆ TFrame3() [4/9]

template<typename RealType >
UE::Geometry::TFrame3< RealType >::TFrame3 ( const TVector< RealType > &  OriginIn,
const TVector< RealType > &  SetZ 
)
inline

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

Parameters
OriginInorigin of frame
SetZtarget Z axis

◆ TFrame3() [5/9]

template<typename RealType >
UE::Geometry::TFrame3< RealType >::TFrame3 ( const TVector< RealType > &  OriginIn,
const TVector< RealType > &  X,
const TVector< RealType > &  Y,
const TVector< RealType > &  Z 
)
inline

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

Parameters
OriginInorigin of frame
Xdesired X axis of frame
Ydesired Y axis of frame
Zdesired Z axis of frame

◆ TFrame3() [6/9]

template<typename RealType >
UE::Geometry::TFrame3< RealType >::TFrame3 ( const FTransform Transform)
inlineexplicit

Construct a Frame from an FTransform

◆ TFrame3() [7/9]

template<typename RealType >
UE::Geometry::TFrame3< RealType >::TFrame3 ( const FPlane Plane)
inlineexplicit

Construct a Frame from an FPlane

◆ TFrame3() [8/9]

template<typename RealType >
UE::Geometry::TFrame3< RealType >::TFrame3 ( const FVector OriginIn,
const FQuat RotationIn 
)
inlineexplicit

Construct a Frame from an FVector and FQuat

◆ TFrame3() [9/9]

template<typename RealType >
template<typename RealType2 >
UE::Geometry::TFrame3< RealType >::TFrame3 ( const TFrame3< RealType2 > &  OtherFrame)
inlineexplicit

Convert between TFrame of different types

Member Function Documentation

◆ AlignAxis()

template<typename RealType >
void UE::Geometry::TFrame3< RealType >::AlignAxis ( int  AxisIndex,
const TVector< RealType > &  ToDirection 
)
inline

Align an axis of this frame with a target direction

Parameters
AxisIndexwhich axis to align
ToDirectiontarget direction

◆ ConstrainedAlignAxis()

template<typename RealType >
void UE::Geometry::TFrame3< RealType >::ConstrainedAlignAxis ( int  AxisIndex,
const TVector< RealType > &  ToDirection,
const TVector< RealType > &  AroundVector 
)
inline

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

Parameters
AxisIndexwhich axis to try to align
ToDirectiontarget direction
AroundVectorrotation is constrained to be around this vector (ie this direction in frame stays constant)

◆ ConstrainedAlignPerpAxes()

template<typename RealType >
void UE::Geometry::TFrame3< RealType >::ConstrainedAlignPerpAxes ( int  PerpAxis1 = 0,
int  PerpAxis2 = 1,
int  NormalAxis = 2,
const TVector< RealType > &  UpAxis = TVector<RealType>::UnitZ(),
const TVector< RealType > &  FallbackAxis = TVector<RealType>::UnitX(),
RealType  UpDotTolerance = (RealType)0.707 
)
inline

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
PerpAxis1Index of first axis orthogonal to NormalAxis
PerpAxis2Index of second axis orthogonal to NormalAxis
NormalAxisAxis of frame to rotate around
UpAxisTarget axis in equator region, defaults to UnitZ
FallbackAxisTarget axis in polar region, defaults to UnitX
UpDotTolerancedefaults to cos(45), ie flip between regions happens roughly half way to poles

◆ FromFrame() [1/3]

template<typename RealType >
TFrame3< RealType > UE::Geometry::TFrame3< RealType >::FromFrame ( const TFrame3< RealType > &  Frame) const
inline
Returns
input Frame transformed from local coordinate system of this Frame into "World" coordinate system

◆ FromFrame() [2/3]

template<typename RealType >
TQuaternion< RealType > UE::Geometry::TFrame3< RealType >::FromFrame ( const TQuaternion< RealType > &  Quat) const
inline
Returns
input Quaternion transformed from local coordinate system of Frame into "World" coordinate system

◆ FromFrame() [3/3]

template<typename RealType >
TRay< RealType > UE::Geometry::TFrame3< RealType >::FromFrame ( const TRay< RealType > &  Ray) const
inline
Returns
input Ray transformed from local coordinate system of Frame into "World" coordinate system

◆ FromFramePoint()

template<typename RealType >
TVector< RealType > UE::Geometry::TFrame3< RealType >::FromFramePoint ( const TVector< RealType > &  Point) const
inline
Returns
input Point transformed from local coordinate system of Frame into "World" coordinate system

◆ FromFrameVector()

template<typename RealType >
TVector< RealType > UE::Geometry::TFrame3< RealType >::FromFrameVector ( const TVector< RealType > &  Vector) const
inline
Returns
input Vector transformed from local coordinate system of Frame into "World" coordinate system

◆ FromPlaneUV()

template<typename RealType >
TVector< RealType > UE::Geometry::TFrame3< RealType >::FromPlaneUV ( const TVector2< RealType > &  PosUV,
int  PlaneNormalAxis = 2 
) const
inline

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

Parameters
PosUVlocal UV plane coordinates
PlaneNormalAxiswhich plane to map to, identified by perpendicular normal. Default is 2, ie normal is Z, plane is (X,Y)
Returns
3D coordinates in frame's plane (including Origin translation)

◆ GetAxes()

template<typename RealType >
void UE::Geometry::TFrame3< RealType >::GetAxes ( TVector< RealType > &  X,
TVector< RealType > &  Y,
TVector< RealType > &  Z 
) const
inline
Returns
X/Y/Z axes of frame. This is more efficient than calculating each axis separately.

◆ GetAxis()

template<typename RealType >
TVector< RealType > UE::Geometry::TFrame3< RealType >::GetAxis ( int  AxisIndex) const
inline
Parameters
AxisIndexindex of axis of frame, either 0, 1, or 2
Returns
axis vector

◆ PointAt() [1/2]

template<typename RealType >
TVector< RealType > UE::Geometry::TFrame3< RealType >::PointAt ( const TVector< RealType > &  Point) const
inline
Returns
point at distances along frame axes

◆ PointAt() [2/2]

template<typename RealType >
TVector< RealType > UE::Geometry::TFrame3< RealType >::PointAt ( RealType  X,
RealType  Y,
RealType  Z 
) const
inline
Returns
point at distances along frame axes

◆ RayPlaneIntersection()

template<typename RealType >
bool UE::Geometry::TFrame3< RealType >::RayPlaneIntersection ( const TVector< RealType > &  RayOrigin,
const TVector< RealType > &  RayDirection,
int  PlaneNormalAxis,
UE::Math::TVector< RealType > &  HitPointOut 
) const
inline

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

Parameters
RayOriginorigin of ray
RayDirectiondirection of ray
PlaneNormalAxiswhich axis of frame to use as plane normal
HitPointOutintersection point, or invalid point if ray does not hit plane or is parallel to plane
Returns
true if ray intersects plane and HitPointOut is valid

◆ Rotate()

template<typename RealType >
void UE::Geometry::TFrame3< RealType >::Rotate ( const TQuaternion< RealType > &  Quat)
inline

Rotate this frame by given quaternion

◆ ToFPlane()

template<typename RealType >
FPlane UE::Geometry::TFrame3< RealType >::ToFPlane ( ) const
inline
Returns
conversion of this Frame to FPlane

◆ ToFrame() [1/3]

template<typename RealType >
TFrame3< RealType > UE::Geometry::TFrame3< RealType >::ToFrame ( const TFrame3< RealType > &  Frame) const
inline
Returns
input Frame transformed into local coordinate system of this Frame

◆ ToFrame() [2/3]

template<typename RealType >
TQuaternion< RealType > UE::Geometry::TFrame3< RealType >::ToFrame ( const TQuaternion< RealType > &  Quat) const
inline
Returns
input Quaternion transformed into local coordinate system of Frame

◆ ToFrame() [3/3]

template<typename RealType >
TRay< RealType > UE::Geometry::TFrame3< RealType >::ToFrame ( const TRay< RealType > &  Ray) const
inline
Returns
input Ray transformed into local coordinate system of Frame

◆ ToFramePoint()

template<typename RealType >
TVector< RealType > UE::Geometry::TFrame3< RealType >::ToFramePoint ( const TVector< RealType > &  Point) const
inline
Returns
input Point transformed into local coordinate system of Frame

◆ ToFrameVector()

template<typename RealType >
TVector< RealType > UE::Geometry::TFrame3< RealType >::ToFrameVector ( const TVector< RealType > &  Vector) const
inline
Returns
input Vector transformed into local coordinate system of Frame

◆ ToFTransform()

template<typename RealType >
FTransform UE::Geometry::TFrame3< RealType >::ToFTransform ( ) const
inline
Returns
conversion of this Frame to FTransform

◆ ToInverseFTransform()

template<typename RealType >
FTransform UE::Geometry::TFrame3< RealType >::ToInverseFTransform ( ) const
inline
Returns
conversion of this Frame to an inverse FTransform

◆ ToInverseTransform()

template<typename RealType >
TTransformSRT3< RealType > UE::Geometry::TFrame3< RealType >::ToInverseTransform ( ) const
inline
Returns
conversion of this Frame to an inverse TTransform

◆ ToPlane()

template<typename RealType >
TVector< RealType > UE::Geometry::TFrame3< RealType >::ToPlane ( const TVector< RealType > &  Pos,
int  PlaneNormalAxis = 2 
) const
inline

Project a point onto one of the planes of the frame

Parameters
Pos3D position
PlaneNormalAxiswhich plane to project onto, identified by perpendicular normal. Default is 2, ie normal is Z, plane is (X,Y)
Returns
3D coordinate in the plane

◆ ToPlaneUV()

template<typename RealType >
TVector2< RealType > UE::Geometry::TFrame3< RealType >::ToPlaneUV ( const TVector< RealType > &  Pos,
int  PlaneNormalAxis = 2 
) const
inline

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

Parameters
Pos3D position
PlaneNormalAxiswhich plane to project onto, identified by perpendicular normal. Default is 2, ie normal is Z, plane is (X,Y)
Returns
2D coordinates in UV plane, relative to origin

◆ ToTransform()

template<typename RealType >
TTransformSRT3< RealType > UE::Geometry::TFrame3< RealType >::ToTransform ( ) const
inline
Returns
conversion of this Frame to TTransform

◆ Transform() [1/2]

template<typename RealType >
void UE::Geometry::TFrame3< RealType >::Transform ( const FTransform XForm)
inline

transform this frame by the given transform. Note: Ignores scale, as TFrame3 does not support scaling

◆ Transform() [2/2]

template<typename RealType >
void UE::Geometry::TFrame3< RealType >::Transform ( const TTransformSRT3< RealType > &  XForm)
inline

transform this frame by the given transform. Note: Ignores scale, as TFrame3 does not support scaling

◆ X()

template<typename RealType >
TVector< RealType > UE::Geometry::TFrame3< RealType >::X ( ) const
inline
Returns
X axis of frame (axis 0)

◆ Y()

template<typename RealType >
TVector< RealType > UE::Geometry::TFrame3< RealType >::Y ( ) const
inline
Returns
Y axis of frame (axis 1)

◆ Z()

template<typename RealType >
TVector< RealType > UE::Geometry::TFrame3< RealType >::Z ( ) const
inline
Returns
Z axis of frame (axis 2)

Member Data Documentation

◆ Origin

template<typename RealType >
TVector<RealType> UE::Geometry::TFrame3< RealType >::Origin

Origin of the frame

◆ Rotation

template<typename RealType >
TQuaternion<RealType> UE::Geometry::TFrame3< RealType >::Rotation

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


The documentation for this struct was generated from the following file: