MCPcopy Index your code
hub / github.com/HandmadeMath/HandmadeMath / HMM_InvGeneralM3

Function HMM_InvGeneralM3

HandmadeMath.h:1430–1447  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1428
1429COVERAGE(HMM_InvGeneralM3, 1)
1430static inline HMM_Mat3 HMM_InvGeneralM3(HMM_Mat3 Matrix)
1431{
1432 ASSERT_COVERED(HMM_InvGeneralM3);
1433
1434 HMM_Mat3 Cross;
1435 Cross.Columns[0] = HMM_Cross(Matrix.Columns[1], Matrix.Columns[2]);
1436 Cross.Columns[1] = HMM_Cross(Matrix.Columns[2], Matrix.Columns[0]);
1437 Cross.Columns[2] = HMM_Cross(Matrix.Columns[0], Matrix.Columns[1]);
1438
1439 float InvDeterminant = 1.0f / HMM_DotV3(Cross.Columns[2], Matrix.Columns[2]);
1440
1441 HMM_Mat3 Result;
1442 Result.Columns[0] = HMM_MulV3F(Cross.Columns[0], InvDeterminant);
1443 Result.Columns[1] = HMM_MulV3F(Cross.Columns[1], InvDeterminant);
1444 Result.Columns[2] = HMM_MulV3F(Cross.Columns[2], InvDeterminant);
1445
1446 return HMM_TransposeM3(Result);
1447}
1448
1449/*
1450 * 4x4 Matrices

Callers 2

HMM_InvGeneralFunction · 0.85
TESTFunction · 0.85

Calls 4

HMM_CrossFunction · 0.85
HMM_DotV3Function · 0.85
HMM_MulV3FFunction · 0.85
HMM_TransposeM3Function · 0.85

Tested by

no test coverage detected