27 lines
498 B
C
27 lines
498 B
C
//
|
|
// Created by karl on 07.01.20.
|
|
//
|
|
|
|
#ifndef ECSGAME_MOUSELOOK_H
|
|
#define ECSGAME_MOUSELOOK_H
|
|
|
|
#include <glm/glm.hpp>
|
|
#include <glm/gtc/quaternion.hpp>
|
|
|
|
struct MouseLook {
|
|
explicit MouseLook(float sensitivity) : sensitivity(sensitivity) {}
|
|
|
|
glm::vec3 get_look_direction() { return glm::mat3_cast(rotation) * glm::vec3(0, 0, -1); }
|
|
|
|
float sensitivity;
|
|
|
|
double yaw = 0.0;
|
|
double pitch = 0.0;
|
|
|
|
glm::quat rotation;
|
|
|
|
bool is_active = true;
|
|
};
|
|
|
|
#endif // ECSGAME_MOUSELOOK_H
|