UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
Matrix3x4.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3#pragma once
4
5#include "CoreMinimal.h"
7
13{
14 float M[3][4];
15
16 inline void SetMatrix(const FMatrix& Mat)
17 {
18 const FMatrix::FReal* RESTRICT Src = &(Mat.M[0][0]);
19 float* RESTRICT Dest = &(M[0][0]);
20
21 Dest[0] = (float)Src[0]; // [0][0]
22 Dest[1] = (float)Src[1]; // [0][1]
23 Dest[2] = (float)Src[2]; // [0][2]
24 Dest[3] = (float)Src[3]; // [0][3]
25
26 Dest[4] = (float)Src[4]; // [1][0]
27 Dest[5] = (float)Src[5]; // [1][1]
28 Dest[6] = (float)Src[6]; // [1][2]
29 Dest[7] = (float)Src[7]; // [1][3]
30
31 Dest[8] = (float)Src[8]; // [2][0]
32 Dest[9] = (float)Src[9]; // [2][1]
33 Dest[10] = (float)Src[10]; // [2][2]
34 Dest[11] = (float)Src[11]; // [2][3]
35 }
36
37 inline void SetMatrixTranspose(const FMatrix& Mat)
38 {
39 const FMatrix::FReal* RESTRICT Src = &(Mat.M[0][0]);
40 float* RESTRICT Dest = &(M[0][0]);
41
42 Dest[0] = (float)Src[0]; // [0][0]
43 Dest[1] = (float)Src[4]; // [1][0]
44 Dest[2] = (float)Src[8]; // [2][0]
45 Dest[3] = (float)Src[12]; // [3][0]
46
47 Dest[4] = (float)Src[1]; // [0][1]
48 Dest[5] = (float)Src[5]; // [1][1]
49 Dest[6] = (float)Src[9]; // [2][1]
50 Dest[7] = (float)Src[13]; // [3][1]
51
52 Dest[8] = (float)Src[2]; // [0][2]
53 Dest[9] = (float)Src[6]; // [1][2]
54 Dest[10] = (float)Src[10]; // [2][2]
55 Dest[11] = (float)Src[14]; // [3][2]
56 }
57
58 inline void SetIdentity()
59 {
60 float* RESTRICT Dest = &(M[0][0]);
61
62 Dest[ 0] = 1.0f; // [0][0]
63 Dest[ 1] = 0.0f; // [0][1]
64 Dest[ 2] = 0.0f; // [0][2]
65 Dest[ 3] = 0.0f; // [0][3]
66
67 Dest[ 4] = 0.0f; // [1][0]
68 Dest[ 5] = 1.0f; // [1][1]
69 Dest[ 6] = 0.0f; // [1][2]
70 Dest[ 7] = 0.0f; // [1][3]
71
72 Dest[ 8] = 0.0f; // [2][0]
73 Dest[ 9] = 0.0f; // [2][1]
74 Dest[10] = 1.0f; // [2][2]
75 Dest[11] = 0.0f; // [2][3]
76 }
78
81{
82 Ar << M.M[0][0] << M.M[0][1] << M.M[0][2] << M.M[0][3];
83 Ar << M.M[1][0] << M.M[1][1] << M.M[1][2] << M.M[1][3];
84 Ar << M.M[2][0] << M.M[2][1] << M.M[2][2] << M.M[2][3];
85 return Ar;
86}
87
88template<>
90{
92 static constexpr int32 NumRows = 3;
93 static constexpr int32 NumColumns = 4;
94 static constexpr int32 NumElements = 0;
95 static constexpr int32 Alignment = 16;
96 static constexpr bool bIsStoredInConstantBuffer = true;
97
99
101};
102
123
#define NULL
Definition oodle2base.h:134
#define FORCEINLINE
Definition AndroidPlatform.h:140
#define GCC_ALIGN(n)
Definition AndroidPlatform.h:163
#define MS_ALIGN(n)
Definition Platform.h:916
FPlatformTypes::int64 int64
A 64-bit signed integer.
Definition Platform.h:1127
FPlatformTypes::int32 int32
A 32-bit signed integer.
Definition Platform.h:1125
#define RESTRICT
Definition Platform.h:706
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
FArchive & operator<<(FArchive &Ar, FMatrix3x4 &M)
Definition Matrix3x4.h:80
ENGINE_API void TransposeTransforms(FMatrix3x4 *DstTransforms, const FMatrix44f *SrcTransforms, int64 Count)
Definition Matrix3x4.cpp:5
FORCEINLINE void TransposeTransform(FMatrix3x4 &DstTransform, const FMatrix44f &SrcTransform)
Definition Matrix3x4.h:103
EUniformBufferBaseType
Definition RHIDefinitions.h:634
@ UBMT_FLOAT32
Definition RHIDefinitions.h:644
USkinnedMeshComponent float
Definition SkinnedMeshComponent.h:60
#define VectorShuffle(Vec1, Vec2, X, Y, Z, W)
Definition UnrealMathFPU.h:652
VectorRegister4Float VectorLoadAligned(const float *Ptr)
Definition UnrealMathFPU.h:451
void VectorStoreAligned(const VectorRegister4Float &Vec, float *Ptr)
Definition UnrealMathFPU.h:534
Definition Archive.h:1208
Definition ShaderParameterMetadata.h:136
Definition ShaderParameterMacros.h:36
static const FShaderParametersMetadata * GetStructMetadata()
Definition Matrix3x4.h:100
TAlignedTypedef< FMatrix3x4, Alignment >::Type TAlignedType
Definition Matrix3x4.h:98
Definition ShaderParameterMacros.h:895
static constexpr int32 NumElements
Definition ShaderParameterMacros.h:906
static constexpr bool bIsStoredInConstantBuffer
Definition ShaderParameterMacros.h:916
static constexpr int32 NumColumns
Definition ShaderParameterMacros.h:901
static constexpr EUniformBufferBaseType BaseType
Definition ShaderParameterMacros.h:897
static constexpr int32 Alignment
Definition ShaderParameterMacros.h:909
static constexpr int32 NumRows
Definition ShaderParameterMacros.h:900
double FReal
Definition Matrix.h:47
Definition UnrealMathFPU.h:20