mirror of
https://github.com/antopilo/Nuake.git
synced 2026-09-09 20:08:57 +03:00
Partial fix
This commit is contained in:
@@ -4,10 +4,11 @@ using namespace Nuake;
|
||||
|
||||
Quat Nuake::QuatFromEuler(float x, float y, float z)
|
||||
{
|
||||
return Quat(Vector3(Rad(x), Rad(y), Rad(z)));
|
||||
return Quat(Vector3(Rad(z), Rad(y), Rad(x)));
|
||||
}
|
||||
|
||||
Vector3 Nuake::QuatToDirection(const Quat& quat)
|
||||
{
|
||||
return quat * Vector3(0, 0, -1);
|
||||
//return quat * Vector3(0, 0, -1);
|
||||
return glm::rotate(glm::inverse(quat), glm::vec3(-1.0, 0.0, 0.0));
|
||||
}
|
||||
@@ -52,7 +52,7 @@ namespace Nuake
|
||||
//cam->cameraRight = glm::normalize(glm::cross(cam->up, cam->cameraFront));
|
||||
Direction = glm::normalize(direction);
|
||||
Right = glm::normalize(glm::cross(Vector3(0, 1, 0), Direction));
|
||||
//Up = glm::normalize(glm::cross(Direction, Right))
|
||||
//Up = glm::normalize(glm::cross(Direction, Right));
|
||||
}
|
||||
|
||||
Vector3 Camera::GetTranslation() {
|
||||
|
||||
@@ -110,7 +110,8 @@ namespace Nuake
|
||||
camera.CameraInstance->Translation = transform.GlobalTranslation;
|
||||
|
||||
const auto& globalRotation = transform.GetGlobalRotation();
|
||||
const auto& forward = QuatToDirection(globalRotation);
|
||||
auto& forward = QuatToDirection(globalRotation);
|
||||
//forward *= -1.0;
|
||||
camera.CameraInstance->SetDirection(forward);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user