mirror of
https://github.com/RetroDECK/Supermodel.git
synced 2024-11-25 15:15:40 +00:00
add maths functions
This commit is contained in:
parent
93f6b01e0b
commit
e7eb912eaa
|
@ -1017,4 +1017,19 @@ bool CNew3D::ClockWiseWinding()
|
|||
}
|
||||
}
|
||||
|
||||
float CNew3D::Determinant3x3(const float m[16]) {
|
||||
|
||||
/*
|
||||
| A B C |
|
||||
M = | D E F |
|
||||
| G H I |
|
||||
|
||||
then the determinant is calculated as follows:
|
||||
|
||||
det M = A * (EI - HF) - B * (DI - GF) + C * (DH - GE)
|
||||
*/
|
||||
|
||||
return m[0] * ((m[5] * m[10]) - (m[6] * m[9])) - m[4] * ((m[1] * m[10]) - (m[2] * m[9])) + m[8] * ((m[1] * m[6]) - (m[2] * m[5]));
|
||||
}
|
||||
|
||||
} // New3D
|
||||
|
|
|
@ -172,6 +172,7 @@ private:
|
|||
enum class AlphaType{ none, poly, texture };
|
||||
void RenderScene(int priority, bool alpha);
|
||||
bool ClockWiseWinding(); // calculate winding with current matrix
|
||||
float Determinant3x3(const float m[16]);
|
||||
|
||||
/*
|
||||
* Data
|
||||
|
|
Loading…
Reference in a new issue