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
21
libs/citro3d/source/maths/mtx_translate.c
Normal file
21
libs/citro3d/source/maths/mtx_translate.c
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
#include <c3d/maths.h>
|
||||
|
||||
void Mtx_Translate(C3D_Mtx* mtx, float x, float y, float z, bool bRightSide)
|
||||
{
|
||||
|
||||
C3D_FVec v = FVec4_New(x, y, z, 1.0f);
|
||||
int i, j;
|
||||
|
||||
if (bRightSide)
|
||||
{
|
||||
for (i = 0; i < 4; ++i)
|
||||
mtx->r[i].w = FVec4_Dot(mtx->r[i], v);
|
||||
}
|
||||
else
|
||||
{
|
||||
for (j = 0; j < 3; ++j)
|
||||
for (i = 0; i < 4; ++i)
|
||||
mtx->r[j].c[i] += mtx->r[3].c[i] * v.c[3-j];
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue