UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
InverseRotationMatrix.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3#pragma once
4
5#include "CoreTypes.h"
7#include "Math/Plane.h"
8#include "Math/Matrix.h"
9
10namespace UE {
11namespace Math {
12
14template<typename T>
16 : public TMatrix<T>
17{
18public:
25
26 // Conversion to other type.
27 template<typename FArg UE_REQUIRES(!std::is_same_v<T, FArg>)>
29 : TMatrix<T>(From)
30 {
31 }
32};
33
34template<typename T>
36 : TMatrix<T>(
37 TMatrix<T>( // Yaw
38 TPlane<T>(+FMath::Cos(Rot.Yaw * UE_PI / 180.f), -FMath::Sin(Rot.Yaw * UE_PI / 180.f), 0.0f, 0.0f),
39 TPlane<T>(+FMath::Sin(Rot.Yaw * UE_PI / 180.f), +FMath::Cos(Rot.Yaw * UE_PI / 180.f), 0.0f, 0.0f),
40 TPlane<T>(0.0f, 0.0f, 1.0f, 0.0f),
41 TPlane<T>(0.0f, 0.0f, 0.0f, 1.0f)) *
42 TMatrix<T>( // Pitch
43 TPlane<T>(+FMath::Cos(Rot.Pitch * UE_PI / 180.f), 0.0f, -FMath::Sin(Rot.Pitch * UE_PI / 180.f), 0.0f),
44 TPlane<T>(0.0f, 1.0f, 0.0f, 0.0f),
45 TPlane<T>(+FMath::Sin(Rot.Pitch * UE_PI / 180.f), 0.0f, +FMath::Cos(Rot.Pitch * UE_PI / 180.f), 0.0f),
46 TPlane<T>(0.0f, 0.0f, 0.0f, 1.0f)) *
47 TMatrix<T>( // Roll
48 TPlane<T>(1.0f, 0.0f, 0.0f, 0.0f),
49 TPlane<T>(0.0f, +FMath::Cos(Rot.Roll * UE_PI / 180.f), +FMath::Sin(Rot.Roll * UE_PI / 180.f), 0.0f),
50 TPlane<T>(0.0f, -FMath::Sin(Rot.Roll * UE_PI / 180.f), +FMath::Cos(Rot.Roll * UE_PI / 180.f), 0.0f),
51 TPlane<T>(0.0f, 0.0f, 0.0f, 1.0f))
52 )
53{ }
54
55} // namespace Math
56} // namespace UE
57
59
60template<> struct TIsUECoreVariant<FInverseRotationMatrix44f> { enum { Value = true }; };
61template<> struct TIsUECoreVariant<FInverseRotationMatrix44d> { enum { Value = true }; };
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
#define UE_DECLARE_LWC_TYPE(...)
Definition LargeWorldCoordinates.h:27
#define UE_PI
Definition UnrealMathUtility.h:129
Definition AdvancedWidgetsModule.cpp:13
Definition UnrealMathUtility.h:270
Definition IsUECoreType.h:19
@ Value
Definition IsUECoreType.h:20
Definition InverseRotationMatrix.h:17
TInverseRotationMatrix(const TInverseRotationMatrix< FArg > &From)
Definition InverseRotationMatrix.h:28
TInverseRotationMatrix(const TRotator< T > &Rot)
Definition InverseRotationMatrix.h:35
Definition Matrix.h:43
Definition Plane.h:35
Definition Rotator.h:37