Skip to content

Commit

Permalink
d3d_projection_2d_determinant
Browse files Browse the repository at this point in the history
  • Loading branch information
skyfloogle committed Aug 28, 2024
1 parent 4d5de33 commit 45dc854
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
9 changes: 9 additions & 0 deletions gm82dx9.gej
Original file line number Diff line number Diff line change
Expand Up @@ -2215,6 +2215,15 @@
],
"returntype": 2
},
{
"name": "d3d_projection_2d_determinant",
"extname": "",
"calltype": 2,
"helpline": "d3d_projection_2d_determinant()",
"hidden": false,
"argtypes": [],
"returntype": 2
},
{
"name": "d3d_set_alphablend",
"extname": "",
Expand Down
6 changes: 6 additions & 0 deletions source/transform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,12 @@ GMREAL d3d_transform_get_determinant() {
return XMVectorGetX(XMMatrixDeterminant(world_matrix));
}

GMREAL d3d_projection_2d_determinant() {
XMMATRIX M;
Device->GetTransform(D3DTS_PROJECTION,reinterpret_cast<D3DMATRIX*>(&M));
return XMVectorGetX(M.r[0]) * XMVectorGetY(M.r[1]) - XMVectorGetY(M.r[0]) * XMVectorGetX(M.r[1]);
}

// Glossary:
// C: rotation component (either x, y or z)
// CC: 2 rotation components (different components in any order)
Expand Down

0 comments on commit 45dc854

Please sign in to comment.