git.s-ol.nu ~forks/DiligentCore / fa14d39
Math Lib: added Matrix4x4 constructor from float4 rows assiduous 9 months ago
2 changed file(s) with 24 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
10721072 }
10731073 // clang-format on
10741074
1075 // clang-format off
1076 Matrix4x4(const Vector4<T>& Row0,
1077 const Vector4<T>& Row1,
1078 const Vector4<T>& Row2,
1079 const Vector4<T>& Row3) :
1080 _11{Row0.x}, _12{Row0.y}, _13{Row0.z}, _14{Row0.w},
1081 _21{Row1.x}, _22{Row1.y}, _23{Row1.z}, _24{Row1.w},
1082 _31{Row2.x}, _32{Row2.y}, _33{Row2.z}, _34{Row2.w},
1083 _41{Row3.x}, _42{Row3.y}, _43{Row3.z}, _44{Row3.w}
1084 {
1085 }
1086 // clang-format on
1087
10751088 template <typename Y>
10761089 static Matrix4x4 MakeMatrix(const Y& vals)
10771090 {
788788 EXPECT_TRUE(m1 == m2);
789789 auto t = m1.Transpose().Transpose();
790790 EXPECT_TRUE(t == m1);
791
792 // clang-format off
793 float4x4 m3
794 {
795 float4{ 1, 2, 3, 4},
796 float4{ 5, 6, 7, 8},
797 float4{ 9, 10, 11, 12},
798 float4{13, 14, 15, 16}
799 };
800 EXPECT_TRUE(m1 == m3);
801 // clang-format on
791802 }
792803 }
793804