engine
 
载入中...
搜索中...
未找到
Public 成员函数 | 静态 Public 成员函数 | Public 属性 | 静态 Public 属性 | 友元 | 所有成员列表
FRotator结构体 参考

Implements a container for rotation information. 更多...

#include <Rotator.h>

Public 成员函数

FRotator Add (float DeltaPitch, float DeltaYaw, float DeltaRoll)
 Adds to each component of the rotator. 更多...
 
FRotator Clamp () const
 Gets the rotation values so they fall within the range [0,360] 更多...
 
bool ContainsNaN () const
 Utility to check if there are any non-finite values (NaN or Inf) in this Rotator. 更多...
 
bool Equals (const FRotator &R, float Tolerance=KINDA_SMALL_NUMBER) const
 Checks whether two rotators are equal within specified tolerance, when treated as an orientation. 更多...
 
CORE_API FVector Euler () const
 Convert a Rotator into floating-point Euler angles (in degrees). 更多...
 
FORCEINLINE FRotator ()
 Default constructor (no initialization).
 
CORE_API FRotator (const FQuat &Quat)
 Constructor. 更多...
 
FORCEINLINE FRotator (EForceInit)
 Constructor. 更多...
 
FORCEINLINE FRotator (float InF)
 Constructor 更多...
 
FORCEINLINE FRotator (float InPitch, float InYaw, float InRoll)
 Constructor. 更多...
 
float GetComponentForAxis (EAxis::Type Axis) const
 Get a specific component of the vector, given a specific axis by enum
 
FRotator GetDenormalized () const
 Create a copy of this rotator and denormalize, clamping each axis to 0 - 360. 更多...
 
FRotator GetEquivalentRotator () const
 Return a Rotator that has the same rotation but has different degree values for Yaw, Pitch, and Roll. 更多...
 
CORE_API FRotator GetInverse () const
 Returns the inverse of the rotator.
 
float GetManhattanDistance (const FRotator &Rotator) const
 Return the manhattan distance in degrees between this Rotator and the passed in one. 更多...
 
FRotator GetNormalized () const
 Create a copy of this rotator and normalize, removes all winding and creates the "shortest route" rotation. 更多...
 
CORE_API void GetWindingAndRemainder (FRotator &Winding, FRotator &Remainder) const
 Decompose this Rotator into a Winding part (multiples of 360) and a Remainder part. 更多...
 
FRotator GridSnap (const FRotator &RotGrid) const
 Get the rotation, snapped to specified degree segments. 更多...
 
bool InitFromString (const FString &InSourceString)
 Initialize this Rotator based on an FString. 更多...
 
bool IsNearlyZero (float Tolerance=KINDA_SMALL_NUMBER) const
 Checks whether rotator is nearly zero within specified tolerance, when treated as an orientation. 更多...
 
bool IsZero () const
 Checks whether this has exactly zero rotation, when treated as an orientation. 更多...
 
void Normalize ()
 In-place normalize, removes all winding and creates the "shortest route" rotation.
 
bool operator!= (const FRotator &V) const
 Checks whether two rotators are different. 更多...
 
FRotator operator* (float Scale) const
 Get the result of scaling this rotator. 更多...
 
FRotator operator*= (float Scale)
 Multiply this rotator by a scaling factor. 更多...
 
FRotator operator+ (const FRotator &R) const
 Get the result of adding a rotator to this. 更多...
 
FRotator operator+= (const FRotator &R)
 Adds another rotator to this. 更多...
 
FRotator operator- (const FRotator &R) const
 Get the result of subtracting a rotator from this. 更多...
 
FRotator operator-= (const FRotator &R)
 Subtracts another rotator from this. 更多...
 
bool operator== (const FRotator &R) const
 Checks whether two rotators are identical. 更多...
 
CORE_API FQuat Quaternion () const
 Get Rotation as a quaternion. 更多...
 
CORE_API FVector RotateVector (const FVector &V) const
 Rotate a vector rotated by this rotator. 更多...
 
CORE_API void SerializeCompressed (FArchive &Ar)
 Serializes the rotator compressed for e.g. 更多...
 
CORE_API void SerializeCompressedShort (FArchive &Ar)
 Serializes the rotator compressed for e.g. 更多...
 
void SetClosestToMe (FRotator &MakeClosest) const
 Modify if necessary the passed in rotator to be the closest rotator to it based upon it's equivalent. 更多...
 
void SetComponentForAxis (EAxis::Type Axis, float Component)
 Set a specified componet of the vector, given a specific axis by enum
 
FString ToCompactString () const
 Get a short textural representation of this vector, for compact readable logging.
 
FString ToString () const
 Get a textual representation of the vector. 更多...
 
CORE_API FVector UnrotateVector (const FVector &V) const
 Returns the vector rotated by the inverse of this rotator. 更多...
 
CORE_API FVector Vector () const
 Convert a rotation into a unit vector facing in its direction. 更多...
 

静态 Public 成员函数

static float ClampAxis (float Angle)
 Clamps an angle to the range of [0, 360). 更多...
 
static uint8 CompressAxisToByte (float Angle)
 Compresses a floating point angle into a byte. 更多...
 
static uint16 CompressAxisToShort (float Angle)
 Compress a floating point angle into a word. 更多...
 
static float DecompressAxisFromByte (uint8 Angle)
 Decompress a word into a floating point angle. 更多...
 
static float DecompressAxisFromShort (uint16 Angle)
 Decompress a short into a floating point angle. 更多...
 
static CORE_API FRotator MakeFromEuler (const FVector &Euler)
 Convert a vector of floating-point Euler angles (in degrees) into a Rotator. 更多...
 
static float NormalizeAxis (float Angle)
 Clamps an angle to the range of (-180, 180]. 更多...
 

Public 属性

float Pitch
 Rotation around the right axis (around Y axis), Looking up and down (0=Straight Ahead, +Up, -Down)
 
float Roll
 Rotation around the forward axis (around X axis), Tilting your head, 0=Straight, +Clockwise, -CCW.
 
float Yaw
 Rotation around the up axis (around Z axis), Running in circles 0=East, +North, -South.
 

静态 Public 属性

static CORE_API const FRotator ZeroRotator
 A rotator of zero degrees on each axis.
 

友元

FArchive & operator<< (FArchive &Ar, FRotator &R)
 Serializer. 更多...
 

详细描述

Implements a container for rotation information.

All rotation values are stored in degrees.

构造及析构函数说明

◆ FRotator() [1/4]

FORCEINLINE FRotator::FRotator ( float  InF)
explicit

Constructor

参数
InFValue to set all components to.

◆ FRotator() [2/4]

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

Constructor.

参数
InPitchPitch in degrees.
InYawYaw in degrees.
InRollRoll in degrees.

◆ FRotator() [3/4]

FORCEINLINE FRotator::FRotator ( EForceInit  )
explicit

Constructor.

参数
EForceInitForce Init Enum.

◆ FRotator() [4/4]

CORE_API FRotator::FRotator ( const FQuat &  Quat)
explicit

Constructor.

参数
QuatQuaternion used to specify rotation.

成员函数说明

◆ Add()

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

Adds to each component of the rotator.

参数
DeltaPitchChange in pitch. (+/-)
DeltaYawChange in yaw. (+/-)
DeltaRollChange in roll. (+/-)
返回
Copy of rotator after addition.

◆ Clamp()

FORCEINLINE FRotator FRotator::Clamp ( ) const

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

返回
Clamped version of rotator.

◆ ClampAxis()

FORCEINLINE float FRotator::ClampAxis ( float  Angle)
static

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

参数
AngleThe angle to clamp.
返回
The clamped angle.

◆ CompressAxisToByte()

FORCEINLINE uint8 FRotator::CompressAxisToByte ( float  Angle)
static

Compresses a floating point angle into a byte.

参数
AngleThe angle to compress.
返回
The angle as a byte.

◆ CompressAxisToShort()

FORCEINLINE uint16 FRotator::CompressAxisToShort ( float  Angle)
static

Compress a floating point angle into a word.

参数
AngleThe angle to compress.
返回
The decompressed angle.

◆ ContainsNaN()

FORCEINLINE bool FRotator::ContainsNaN ( ) const

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

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

◆ DecompressAxisFromByte()

FORCEINLINE float FRotator::DecompressAxisFromByte ( uint8  Angle)
static

Decompress a word into a floating point angle.

参数
AngleThe word angle.
返回
The decompressed angle.

◆ DecompressAxisFromShort()

FORCEINLINE float FRotator::DecompressAxisFromShort ( uint16  Angle)
static

Decompress a short into a floating point angle.

参数
AngleThe word angle.
返回
The decompressed angle.

◆ 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.

参数
RThe other rotator.
ToleranceError Tolerance.
返回
true if two rotators are equal, within specified tolerance, otherwise false.

◆ Euler()

CORE_API FVector FRotator::Euler ( ) const

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

Rotator now stored in degrees.

返回
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.

返回
Denormalized copy of this rotator

◆ GetEquivalentRotator()

FORCEINLINE FRotator FRotator::GetEquivalentRotator ( ) const

Return a Rotator that has the same rotation but has different degree values for Yaw, Pitch, and Roll.

This rotator should be within -180,180 range,

返回
A Rotator with the same rotation but different degrees.

◆ GetManhattanDistance()

FORCEINLINE float FRotator::GetManhattanDistance ( const FRotator &  Rotator) const

Return the manhattan distance in degrees between this Rotator and the passed in one.

参数
Rotator[In]the Rotator we are comparing with.
返回
Distance(Manhattan) between the two rotators.

◆ GetNormalized()

FORCEINLINE FRotator FRotator::GetNormalized ( ) const

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

返回
Normalized copy of this rotator

◆ GetWindingAndRemainder()

CORE_API 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.

参数
Winding[Out]the Winding part of this Rotator
Remainder[Out]the Remainder

◆ GridSnap()

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

Get the rotation, snapped to specified degree segments.

参数
RotGridA Rotator specifying how to snap each component.
返回
Snapped version of rotation.

◆ InitFromString()

FORCEINLINE 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.

参数
InSourceStringFString containing the rotator values.
返回
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.

参数
ToleranceError Tolerance.
返回
true if rotator is nearly zero, within specified tolerance, otherwise false.

◆ 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.

返回
true if this has exactly zero rotation, otherwise false.

◆ MakeFromEuler()

static CORE_API 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

参数
EulerEuler angle vector.
返回
A rotator from a Euler angle.

◆ NormalizeAxis()

FORCEINLINE float FRotator::NormalizeAxis ( float  Angle)
static

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

参数
AngleThe Angle to clamp.
返回
The clamped angle.

◆ operator!=()

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

Checks whether two rotators are different.

参数
VThe other rotator.
返回
true if two rotators are different, otherwise false.

◆ operator*()

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

Get the result of scaling this rotator.

参数
ScaleThe scaling factor.
返回
The result of scaling.

◆ operator*=()

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

Multiply this rotator by a scaling factor.

参数
ScaleThe scaling factor.
返回
Copy of the rotator after scaling.

◆ operator+()

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

Get the result of adding a rotator to this.

参数
RThe other rotator.
返回
The result of adding a rotator to this.

◆ operator+=()

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

Adds another rotator to this.

参数
RThe other rotator.
返回
Copy of rotator after addition.

◆ operator-()

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

Get the result of subtracting a rotator from this.

参数
RThe other rotator.
返回
The result of subtracting a rotator from this.

◆ operator-=()

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

Subtracts another rotator from this.

参数
RThe other rotator.
返回
Copy of rotator after subtraction.

◆ operator==()

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

Checks whether two rotators are identical.

This checks each component for exact equality.

参数
RThe other rotator.
返回
true if two rotators are identical, otherwise false.
参见
Equals()

◆ Quaternion()

CORE_API FQuat FRotator::Quaternion ( ) const

Get Rotation as a quaternion.

返回
Rotation as a quaternion.

◆ RotateVector()

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

Rotate a vector rotated by this rotator.

参数
VThe vector to rotate.
返回
The rotated vector.

◆ SerializeCompressed()

CORE_API void FRotator::SerializeCompressed ( FArchive &  Ar)

Serializes the rotator compressed for e.g.

network transmission.

参数
ArArchive to serialize to/ from

◆ SerializeCompressedShort()

CORE_API void FRotator::SerializeCompressedShort ( FArchive &  Ar)

Serializes the rotator compressed for e.g.

network transmission (use shorts though).

参数
ArArchive to serialize to/ from

◆ SetClosestToMe()

FORCEINLINE void FRotator::SetClosestToMe ( FRotator &  MakeClosest) const

Modify if necessary the passed in rotator to be the closest rotator to it based upon it's equivalent.

This Rotator should be within (-180, 180], usually just constructed from a Matrix or a Quaternion.

参数
MakeClosest[In/Out]the Rotator we want to make closest to us. Should be between (-180, 180]. This Rotator may change if we need to use different degree values to make it closer.

◆ ToString()

FORCEINLINE FString FRotator::ToString ( ) const

Get a textual representation of the vector.

返回
Text describing the vector.

◆ UnrotateVector()

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

Returns the vector rotated by the inverse of this rotator.

参数
VThe vector to rotate.
返回
The rotated vector.

◆ Vector()

CORE_API FVector FRotator::Vector ( ) const

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

返回
Rotation as a unit direction vector.

友元及相关函数文档

◆ operator<<

FArchive & operator<< ( FArchive &  Ar,
FRotator &  R 
)
friend

Serializer.

参数
ArSerialization Archive.
RRotator being serialized.
返回
Reference to Archive after serialization.

该结构体的文档由以下文件生成: