UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
ScaleMatrix.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"
6#include "Math/Plane.h"
7#include "Math/Matrix.h"
8
9namespace UE {
10namespace Math {
11
15template<typename T>
17 : public TMatrix<T>
18{
19public:
20
25
30
31 // Conversion to other type.
32 template<typename FArg UE_REQUIRES(!std::is_same_v<T, FArg>)>
33 [[nodiscard]] explicit TScaleMatrix(const TScaleMatrix<FArg>& From)
34 : TMatrix<T>(From)
35 {
36 }
37
40 {
41 return TScaleMatrix<T>(Scale);
42 }
43
46 {
47 return TScaleMatrix<T>(Scale);
48 }
49};
50
51
52/* FScaleMatrix inline functions
53 *****************************************************************************/
54
55template<typename T>
57 : TMatrix<T>(
58 TPlane<T>(Scale, 0.0f, 0.0f, 0.0f),
59 TPlane<T>(0.0f, Scale, 0.0f, 0.0f),
60 TPlane<T>(0.0f, 0.0f, Scale, 0.0f),
61 TPlane<T>(0.0f, 0.0f, 0.0f, 1.0f)
62 )
63{ }
64
65
66template<typename T>
68 : TMatrix<T>(
69 TPlane<T>(Scale.X, 0.0f, 0.0f, 0.0f),
70 TPlane<T>(0.0f, Scale.Y, 0.0f, 0.0f),
71 TPlane<T>(0.0f, 0.0f, Scale.Z, 0.0f),
72 TPlane<T>(0.0f, 0.0f, 0.0f, 1.0f)
73 )
74{ }
75
76} // namespace Math
77} // namespace UE
78
80
81template<> struct TIsUECoreVariant<FScaleMatrix44f> { enum { Value = true }; };
82template<> struct TIsUECoreVariant<FScaleMatrix44d> { enum { Value = true }; };
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
#define X(Name, Desc)
Definition FormatStringSan.h:47
#define UE_DECLARE_LWC_TYPE(...)
Definition LargeWorldCoordinates.h:27
Definition AdvancedWidgetsModule.cpp:13
Definition IsUECoreType.h:19
@ Value
Definition IsUECoreType.h:20
Definition Matrix.h:43
Definition Plane.h:35
Definition ScaleMatrix.h:18
static TMatrix< T > Make(const TVector< T > &Scale)
Definition ScaleMatrix.h:45
TScaleMatrix(const TScaleMatrix< FArg > &From)
Definition ScaleMatrix.h:33
static TMatrix< T > Make(T Scale)
Definition ScaleMatrix.h:39
TScaleMatrix(T Scale)
Definition ScaleMatrix.h:56
Definition Vector.h:51