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
16
libs/citro3d/source/maths/quat_rotate.c
Normal file
16
libs/citro3d/source/maths/quat_rotate.c
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
#include <c3d/maths.h>
|
||||
|
||||
C3D_FQuat Quat_Rotate(C3D_FQuat q, C3D_FVec axis, float r, bool bRightSide)
|
||||
{
|
||||
float halfAngle = r/2.0f;
|
||||
float s = sinf(halfAngle);
|
||||
|
||||
axis = FVec3_Normalize(axis);
|
||||
|
||||
C3D_FQuat tmp = Quat_New(axis.x*s, axis.y*s, axis.z*s, cosf(halfAngle));
|
||||
|
||||
if (bRightSide)
|
||||
return Quat_Multiply(tmp, q);
|
||||
else
|
||||
return Quat_Multiply(q, tmp);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue