FRotator

Syntax

struct FRotator

Remarks

Implements a container for rotation information.

All rotation values are stored in degrees.

Variables

Name Description

Public variable

float

 

Pitch

Rotation around the right axis (around Y axis), Looking up and down (0=Straight Ahead, +Up, -Down)

Public variable

float

 

Roll

Rotation around the forward axis (around X axis), Tilting your head, 0=Straight, +Clockwise, -CCW.

Public variable

float

 

Yaw

Rotation around the up axis (around Z axis), Running in circles 0=East, +North, -South.

Constructors

Name Description

Public function

FRotator()

Default constructor (no initialization).

Public function

FRotator

(
    float InF
)

Constructor

Public function

FRotator

(
    EForceInit
)

Constructor.

Public function

FRotator

(
    const FQuat & Quat
)

Constructor.

Public function

FRotator

(
    float InPitch,
    float InYaw,
    float InRoll
)

Constructor.

Functions

Name Description

Public function

FRotator

 

Add

(
    float DeltaPitch,
    float DeltaYaw,
    float DeltaRoll
)

Adds to each component of the rotator.

Copy of rotator after addition.

Public function

FRotator

 

Clamp()

Gets the rotation values so they fall within the range [0,360]

Clamped version of rotator.

Public function Static

float

 

ClampAxis

(
    float Angle
)

Clamps an angle to the range of [0, 360).

The clamped angle.

Public function Static

uint8

 

CompressAxisToByte

(
    float Angle
)

Compresses a floating point angle into a byte.

The angle as a byte.

Public function Static

uint16

 

CompressAxisToShort

(
    float Angle
)

Compress a floating point angle into a word.

The decompressed angle.

Public function

bool

 

ContainsNaN()

Utility to check if there are any non-finite values (NaN or Inf) in this Rotator.

Public function Static

float

 

DecompressAxisFromByte

(
    uint16 Angle
)

Decompress a word into a floating point angle.

The decompressed angle.

Public function Static

float

 

DecompressAxisFromShort

(
    uint16 Angle
)

Decompress a short into a floating point angle.

The decompressed angle.

Public function

void

 

DiagnosticCheckNaN

(
    const TCHAR* Message
)

Public function

void

 

DiagnosticCheckNaN()

Public function

bool

 

Equals

(
    const FRotator & R,
    float Tolerance
)

Checks whether two rotators are equal within specified tolerance, when treated as an orientation.

Public function

CORE_APIFVec ...

 

Euler()

Convert a Rotator into floating-point Euler angles (in degrees).

Public function

FRotator

 

GetDenormalized()

Create a copy of this rotator and denormalize, clamping each axis to 0 - 360.

Public function

CORE_APIFRot ...

 

GetInverse()

Returns the inverse of the rotator.

Public function

FRotator

 

GetNormalized()

Create a copy of this rotator and normalize, removes all winding and creates the "shortest route" rotation.

Public function

CORE_API voi...

 

GetWindingAndRemainder

(
    FRotator & Winding,
    FRotator & Remainder
)

Decompose this Rotator into a Winding part (multiples of 360) and a Remainder part.

Public function

FRotator

 

GridSnap

(
    const FRotator & RotGrid
)

Get the rotation, snapped to specified degree segments.

Snapped version of rotation.

Public function

bool

 

InitFromString

(
    const FString & InSourceString
)

Initialize this Rotator based on an FString .

Public function

bool

 

IsNearlyZero

(
    float Tolerance
)

Functions.

Public function

bool

 

IsZero()

Checks whether this has exactly zero rotation, when treated as an orientation.

Public function Static

CORE_APIFRot ...

 

MakeFromEuler

(
    const FVector & Euler
)

Convert a vector of floating-point Euler angles (in degrees) into a Rotator.

Public function

CORE_API boo...

 

NetSerialize

(
    FArchive & Ar,
    UPackageMap * Map,
    bool& bOutSuccess
)

Public function

void

 

Normalize()

In-place normalize, removes all winding and creates the "shortest route" rotation.

Public function Static

float

 

NormalizeAxis

(
    float Angle
)

Clamps an angle to the range of (-180, 180].

The clamped angle.

Public function

CORE_APIFQua ...

 

Quaternion()

Get Rotation as a quaternion.

Rotation as a quaternion.

Public function

CORE_APIFVec ...

 

RotateVector

(
    const FVector & V
)

Rotate a vector rotated by this rotator.

The rotated vector.

Public function

bool

 

Serialize

(
    FArchive & Ar
)

Public function

CORE_API voi...

 

SerializeCompressed

(
    FArchive & Ar
)

Serializes the rotator compressed for e.g. network transmission.

Public function

CORE_API voi...

 

SerializeCompressedShort

(
    FArchive & Ar
)

Serializes the rotator compressed for e.g. network transmission (use shorts though).

Public function

FString

 

ToCompactString()

Get a short textural representation of this vector, for compact readable logging.

Public function

FString

 

ToString()

Get a textual representation of the vector.

Text describing the vector.

Public function

CORE_APIFVec ...

 

UnrotateVector

(
    const FVector & V
)

Returns the vector rotated by the inverse of this rotator.

The rotated vector.

Public function

CORE_APIFVec ...

 

Vector()

Convert a rotation into a unit vector facing in its direction.

Operators

Name Description

Public function

FRotator

 

operator-

(
    const FRotator & R
)

Get the result of subtracting a rotator from this.

Public function

FRotator

 

operator-()

Unary operators.

Public function

bool

 

operator!=

(
    const FRotator & V
)

Checks whether two rotators are different.

true if two rotators are different, otherwise false.

Public function

FRotator

 

operator*

(
    float Scale
)

Get the result of scaling this rotator.

The result of scaling.

Public function

FRotator

 

operator*=

(
    float Scale
)

Multiply this rotator by a scaling factor.

Copy of the rotator after scaling.

Public function

FRotator

 

operator+

(
    const FRotator & R
)

Binary arithmetic operators.

Public function

FRotator

 

operator+=

(
    const FRotator & R
)

Assignment operators.

Public function

FRotator

 

operator-=

(
    const FRotator & R
)

Subtracts another rotator from this.

Copy of rotator after subtraction.

Public function

bool

 

operator==

(
    const FRotator & R
)

Binary comparison operators.

Constants

Name

Description

ZeroRotator

A rotator of zero degrees on each axis.

References

Module

Core

Header

Runtime/Core/Public/Math/Rotator.h