Fixed scripting engine crash and improved transformation system

This commit is contained in:
Antoine Pilote
2023-03-05 18:19:41 -05:00
parent 435d50e655
commit b1edeb387f
11 changed files with 99 additions and 32 deletions

View File

@@ -5,8 +5,9 @@ using namespace Nuake;
Quat Nuake::QuatFromEuler(float x, float y, float z)
{
// Taken from: https://gamedev.stackexchange.com/questions/13436/glm-euler-angles-to-quaternion
Quat QuatAroundX = Quat(x, Vector3(1.0, 0.0, 0.0));
Quat QuatAroundY = Quat(y, Vector3(0.0, 1.0, 0.0));
Quat QuatAroundZ = Quat(z, Vector3(0.0, 0.0, 1.0));
return QuatAroundX * QuatAroundY * QuatAroundZ;
Quat QuatAroundX = glm::angleAxis(glm::radians(x), Vector3(1.0, 0.0, 0.0));
Quat QuatAroundY = glm::angleAxis(glm::radians(y), Vector3(0.0, 1.0, 0.0));
Quat QuatAroundZ = glm::angleAxis(glm::radians(z), Vector3(0.0, 0.0, 1.0));
return QuatAroundZ * QuatAroundX * QuatAroundY;
}