Ark Server API (ASE) - Wiki
Loading...
Searching...
No Matches
FRotator Struct Reference

#include <Rotator.h>

+ Inheritance diagram for FRotator:
+ Collaboration diagram for FRotator:

Public Member Functions

FORCEINLINE FRotator ()
 
FORCEINLINE FRotator (float InF)
 
FORCEINLINE FRotator (float InPitch, float InYaw, float InRoll)
 
FORCEINLINE FRotator (EForceInit)
 
 FRotator (const FQuat &Quat)
 
FRotator operator+ (const FRotator &R) const
 
FRotator operator- (const FRotator &R) const
 
FRotator operator* (float Scale) const
 
FRotator operator*= (float Scale)
 
bool operator== (const FRotator &R) const
 
bool operator!= (const FRotator &V) const
 
FRotator operator+= (const FRotator &R)
 
FRotator operator-= (const FRotator &R)
 
bool IsNearlyZero (float Tolerance=KINDA_SMALL_NUMBER) const
 
bool IsZero () const
 
bool Equals (const FRotator &R, float Tolerance=KINDA_SMALL_NUMBER) const
 
FRotator Add (float DeltaPitch, float DeltaYaw, float DeltaRoll)
 
FRotator GetInverse () const
 
FRotator GridSnap (const FRotator &RotGrid) const
 
FVector Vector () const
 
FQuat Quaternion () const
 
FVector Euler () const
 
FVector RotateVector (const FVector &V) const
 
FVector UnrotateVector (const FVector &V) const
 
FRotator Clamp () const
 
FRotator GetNormalized () const
 
FRotator GetDenormalized () const
 
void Normalize ()
 
void GetWindingAndRemainder (FRotator &Winding, FRotator &Remainder) const
 
FString ToString () const
 
FString ToCompactString () const
 
bool InitFromString (const FString &InSourceString)
 
bool ContainsNaN () const
 

Static Public Member Functions

static float ClampAxis (float Angle)
 
static float NormalizeAxis (float Angle)
 
static uint8 CompressAxisToByte (float Angle)
 
static float DecompressAxisFromByte (uint16 Angle)
 
static uint16 CompressAxisToShort (float Angle)
 
static float DecompressAxisFromShort (uint16 Angle)
 
static FRotator MakeFromEuler (const FVector &Euler)
 

Public Attributes

float Pitch
 
float Yaw
 
float Roll
 

Static Public Attributes

static const FRotator ZeroRotator
 

Detailed Description

Implements a container for rotation information.

All rotation values are stored in degrees.

Definition at line 14 of file Rotator.h.

Constructor & Destructor Documentation

◆ FRotator() [1/5]

FORCEINLINE FRotator::FRotator ( )
inline

Default constructor (no initialization).

Definition at line 36 of file Rotator.h.

◆ FRotator() [2/5]

FORCEINLINE FRotator::FRotator ( float InF)
explicit

Constructor

Parameters
InFValue to set all components to.

Definition at line 369 of file Rotator.h.

◆ FRotator() [3/5]

FORCEINLINE FRotator::FRotator ( float InPitch,
float InYaw,
float InRoll )

Constructor.

Parameters
InPitchPitch in degrees.
InYawYaw in degrees.
InRollRoll in degrees.

Definition at line 375 of file Rotator.h.

+ Here is the caller graph for this function:

◆ FRotator() [4/5]

FORCEINLINE FRotator::FRotator ( EForceInit )
explicit

Constructor.

Parameters
EForceInitForce Init Enum.

Definition at line 381 of file Rotator.h.

+ Here is the caller graph for this function:

◆ FRotator() [5/5]

FRotator::FRotator ( const FQuat & Quat)
explicit

Constructor.

Parameters
QuatQuaternion used to specify rotation.

Member Function Documentation

◆ Add()

FORCEINLINE FRotator FRotator::Add ( float DeltaPitch,
float DeltaYaw,
float DeltaRoll )

Adds to each component of the rotator.

Parameters
DeltaPitchChange in pitch. (+/-)
DeltaYawChange in yaw. (+/-)
DeltaRollChange in roll. (+/-)
Returns
Copy of rotator after addition.

Definition at line 475 of file Rotator.h.

◆ Clamp()

FORCEINLINE FRotator FRotator::Clamp ( ) const

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

Returns
Clamped version of rotator.

Definition at line 484 of file Rotator.h.

+ Here is the call graph for this function:

◆ ClampAxis()

FORCEINLINE float FRotator::ClampAxis ( float Angle)
static

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

Parameters
AngleThe angle to clamp.
Returns
The clamped angle.

Definition at line 490 of file Rotator.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ CompressAxisToByte()

FORCEINLINE uint8 FRotator::CompressAxisToByte ( float Angle)
static

Compresses a floating point angle into a byte.

Parameters
AngleThe angle to compress.
Returns
The angle as a byte.

Definition at line 520 of file Rotator.h.

+ Here is the call graph for this function:

◆ CompressAxisToShort()

FORCEINLINE uint16 FRotator::CompressAxisToShort ( float Angle)
static

Compress a floating point angle into a word.

Parameters
AngleThe angle to compress.
Returns
The decompressed angle.

Definition at line 534 of file Rotator.h.

+ Here is the call graph for this function:

◆ ContainsNaN()

FORCEINLINE bool FRotator::ContainsNaN ( ) const

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

Returns
true if there are any non-finite values in this Rotator, otherwise false.

Definition at line 580 of file Rotator.h.

+ Here is the call graph for this function:

◆ DecompressAxisFromByte()

FORCEINLINE float FRotator::DecompressAxisFromByte ( uint16 Angle)
static

Decompress a word into a floating point angle.

Parameters
AngleThe word angle.
Returns
The decompressed angle.

Definition at line 527 of file Rotator.h.

◆ DecompressAxisFromShort()

FORCEINLINE float FRotator::DecompressAxisFromShort ( uint16 Angle)
static

Decompress a short into a floating point angle.

Parameters
AngleThe word angle.
Returns
The decompressed angle.

Definition at line 541 of file Rotator.h.

◆ Equals()

FORCEINLINE bool FRotator::Equals ( const FRotator & R,
float Tolerance = KINDA_SMALL_NUMBER ) const

Checks whether two rotators are equal within specified tolerance, when treated as an orientation. This means that FRotator(0, 0, 360).Equals(FRotator(0,0,0)) is true, because they represent the same final orientation.

Parameters
RThe other rotator.
ToleranceError Tolerance.
Returns
true if two rotators are equal, within specified tolerance, otherwise false.

Definition at line 459 of file Rotator.h.

+ Here is the call graph for this function:

◆ Euler()

FVector FRotator::Euler ( ) const

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

Returns
Rotation as a Euler angle vector.

◆ GetDenormalized()

FORCEINLINE FRotator FRotator::GetDenormalized ( ) const

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

Returns
Denormalized copy of this rotator

Definition at line 556 of file Rotator.h.

+ Here is the call graph for this function:

◆ GetInverse()

FRotator FRotator::GetInverse ( ) const

Returns the inverse of the rotator.

◆ GetNormalized()

FORCEINLINE FRotator FRotator::GetNormalized ( ) const

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

Returns
Normalized copy of this rotator

Definition at line 548 of file Rotator.h.

+ Here is the call graph for this function:

◆ GetWindingAndRemainder()

void FRotator::GetWindingAndRemainder ( FRotator & Winding,
FRotator & Remainder ) const

Decompose this Rotator into a Winding part (multiples of 360) and a Remainder part. Remainder will always be in [-180, 180] range.

Parameters
Winding[Out]the Winding part of this Rotator
Remainder[Out]the Remainder

◆ GridSnap()

FRotator FRotator::GridSnap ( const FRotator & RotGrid) const

Get the rotation, snapped to specified degree segments.

Parameters
RotGridA Rotator specifying how to snap each component.
Returns
Snapped version of rotation.

◆ InitFromString()

bool FRotator::InitFromString ( const FString & InSourceString)

Initialize this Rotator based on an FString. The String is expected to contain P=, Y=, R=. The FRotator will be bogus when InitFromString returns false.

Parameters
InSourceStringFString containing the rotator values.
Returns
true if the P,Y,R values were read successfully; false otherwise.

◆ IsNearlyZero()

FORCEINLINE bool FRotator::IsNearlyZero ( float Tolerance = KINDA_SMALL_NUMBER) const

Checks whether rotator is nearly zero within specified tolerance, when treated as an orientation. This means that FRotator(0, 0, 360) is "zero", because it is the same final orientation as the zero rotator.

Parameters
ToleranceError Tolerance.
Returns
true if rotator is nearly zero, within specified tolerance, otherwise false.

Definition at line 437 of file Rotator.h.

+ Here is the call graph for this function:

◆ IsZero()

FORCEINLINE bool FRotator::IsZero ( ) const

Checks whether this has exactly zero rotation, when treated as an orientation. This means that FRotator(0, 0, 360) is "zero", because it is the same final orientation as the zero rotator.

Returns
true if this has exactly zero rotation, otherwise false.

Definition at line 453 of file Rotator.h.

+ Here is the call graph for this function:

◆ MakeFromEuler()

static FRotator FRotator::MakeFromEuler ( const FVector & Euler)
static

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

Parameters
EulerEuler angle vector.
Returns
A rotator from a Euler angle.

◆ Normalize()

FORCEINLINE void FRotator::Normalize ( )

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

Definition at line 566 of file Rotator.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ NormalizeAxis()

FORCEINLINE float FRotator::NormalizeAxis ( float Angle)
static

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

Parameters
AngleThe Angle to clamp.
Returns
The clamped angle.

Definition at line 505 of file Rotator.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ operator!=()

FORCEINLINE bool FRotator::operator!= ( const FRotator & V) const

Checks whether two rotators are different.

Parameters
VThe other rotator.
Returns
true if two rotators are different, otherwise false.

Definition at line 417 of file Rotator.h.

◆ operator*()

FORCEINLINE FRotator FRotator::operator* ( float Scale) const

Get the result of scaling this rotator.

Parameters
ScaleThe scaling factor.
Returns
The result of scaling.

Definition at line 398 of file Rotator.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ operator*=()

FORCEINLINE FRotator FRotator::operator*= ( float Scale)

Multiply this rotator by a scaling factor.

Parameters
ScaleThe scaling factor.
Returns
Copy of the rotator after scaling.

Definition at line 404 of file Rotator.h.

◆ operator+()

FORCEINLINE FRotator FRotator::operator+ ( const FRotator & R) const

Get the result of adding a rotator to this.

Parameters
RThe other rotator.
Returns
The result of adding a rotator to this.

Definition at line 386 of file Rotator.h.

+ Here is the call graph for this function:

◆ operator+=()

FORCEINLINE FRotator FRotator::operator+= ( const FRotator & R)

Adds another rotator to this.

Parameters
RThe other rotator.
Returns
Copy of rotator after addition.

Definition at line 423 of file Rotator.h.

◆ operator-()

FORCEINLINE FRotator FRotator::operator- ( const FRotator & R) const

Get the result of subtracting a rotator from this.

Parameters
RThe other rotator.
Returns
The result of subtracting a rotator from this.

Definition at line 392 of file Rotator.h.

+ Here is the call graph for this function:

◆ operator-=()

FORCEINLINE FRotator FRotator::operator-= ( const FRotator & R)

Subtracts another rotator from this.

Parameters
RThe other rotator.
Returns
Copy of rotator after subtraction.

Definition at line 430 of file Rotator.h.

◆ operator==()

FORCEINLINE bool FRotator::operator== ( const FRotator & R) const

Checks whether two rotators are identical. This checks each component for exact equality.

Parameters
RThe other rotator.
Returns
true if two rotators are identical, otherwise false.
See also
Equals()

Definition at line 411 of file Rotator.h.

◆ Quaternion()

FQuat FRotator::Quaternion ( ) const

Get Rotation as a quaternion.

Returns
Rotation as a quaternion.

◆ RotateVector()

FVector FRotator::RotateVector ( const FVector & V) const

Rotate a vector rotated by this rotator.

Parameters
VThe vector to rotate.
Returns
The rotated vector.

◆ ToCompactString()

FString FRotator::ToCompactString ( ) const

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

◆ ToString()

FString FRotator::ToString ( ) const

Get a textual representation of the vector.

Returns
Text describing the vector.

◆ UnrotateVector()

FVector FRotator::UnrotateVector ( const FVector & V) const

Returns the vector rotated by the inverse of this rotator.

Parameters
VThe vector to rotate.
Returns
The rotated vector.

◆ Vector()

FVector FRotator::Vector ( ) const

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

Returns
Rotation as a unit direction vector.

Member Data Documentation

◆ Pitch

float FRotator::Pitch

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

Definition at line 18 of file Rotator.h.

◆ Roll

float FRotator::Roll

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

Definition at line 24 of file Rotator.h.

◆ Yaw

float FRotator::Yaw

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

Definition at line 21 of file Rotator.h.

◆ ZeroRotator

const FRotator FRotator::ZeroRotator
static

A rotator of zero degrees on each axis.

Definition at line 29 of file Rotator.h.


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