mirror of
https://github.com/ctruLua/ctruLua.git
synced 2025-10-28 00:39:30 +00:00
Updated all the libs, added citro3d, added ctr.swkbd (WIP, untested)
This commit is contained in:
parent
68a44645f7
commit
49c87e5526
97 changed files with 7341 additions and 944 deletions
30
libs/citro3d/source/maths/mtx_rotatez.c
Normal file
30
libs/citro3d/source/maths/mtx_rotatez.c
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
#include <c3d/maths.h>
|
||||
|
||||
void Mtx_RotateZ(C3D_Mtx* mtx, float angle, bool bRightSide)
|
||||
{
|
||||
float a, b;
|
||||
float cosAngle = cosf(angle);
|
||||
float sinAngle = sinf(angle);
|
||||
size_t i;
|
||||
|
||||
if (bRightSide)
|
||||
{
|
||||
for (i = 0; i < 4; ++i)
|
||||
{
|
||||
a = mtx->r[i].x*cosAngle + mtx->r[i].y*sinAngle;
|
||||
b = mtx->r[i].y*cosAngle - mtx->r[i].x*sinAngle;
|
||||
mtx->r[i].x = a;
|
||||
mtx->r[i].y = b;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for (i = 0; i < 4; ++i)
|
||||
{
|
||||
a = mtx->r[0].c[i]*cosAngle - mtx->r[1].c[i]*sinAngle;
|
||||
b = mtx->r[1].c[i]*cosAngle + mtx->r[0].c[i]*sinAngle;
|
||||
mtx->r[0].c[i] = a;
|
||||
mtx->r[1].c[i] = b;
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue