SpiecsEngine
 
Loading...
Searching...
No Matches

◆ MouseRotate()

void Spices::MeshController::MouseRotate ( const glm::vec2 & delta) const
private

Definition at line 50 of file MeshController.cpp.

51 {
52 glm::vec3 rot = std::any_cast<TransformComponent*>(m_CameraTranComp)->GetRotation();
53 const float yawSign = GetUpDirection().y < 0 ? -1.0f : 1.0f;
54
55 rot.y += glm::degrees(yawSign * delta.x * RotationSpeed());
56 rot.x += glm::degrees(delta.y * RotationSpeed());
57
58 std::any_cast<TransformComponent*>(m_CameraTranComp)->SetRotation(rot);
59 }
glm::vec3 GetUpDirection() const