wip
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
#include "Global.h"
|
||||
#include "bx/constants.h"
|
||||
#include "bx/math.h"
|
||||
#include <cassert>
|
||||
|
||||
namespace
|
||||
@@ -7,6 +9,31 @@ namespace
|
||||
Game::GameInstance* GameInst = nullptr;
|
||||
}
|
||||
|
||||
Quat Quat::FromEuler(float x, float y, float z)
|
||||
{
|
||||
x *= bx::kPi / 180.0f;
|
||||
y *= bx::kPi / 180.0f;
|
||||
z *= bx::kPi / 180.0f;
|
||||
|
||||
float cX = bx::cos(x);
|
||||
float cY = bx::cos(y);
|
||||
float cZ = bx::cos(z);
|
||||
float sX = bx::sin(x);
|
||||
float sY = bx::sin(y);
|
||||
float sZ = bx::sin(z);
|
||||
|
||||
return Quat{
|
||||
cX * cY * cZ - sX * sY * sZ,
|
||||
sY * cX * cZ - sX * sZ * cY,
|
||||
sX * sY * cZ + sZ * cX * cY,
|
||||
sX * cY * cZ + sY * sZ * cX };
|
||||
}
|
||||
|
||||
Quat Quat::FromEuler(Vec3 rot)
|
||||
{
|
||||
return Quat::FromEuler(rot.X, rot.Y, rot.Z);
|
||||
}
|
||||
|
||||
namespace Game
|
||||
{
|
||||
SharedData& GetShared()
|
||||
|
||||
Reference in New Issue
Block a user