X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fapp%2FFPSController.cpp;h=87591aa254b6d4764c3be09127e192af8234fad3;hb=9da6ac5e93d79e79658a95d5f6efe42146873583;hp=9c7820cf481124b139883cadf2cae5b0c877038a;hpb=745729c1935276e6f49d108a0a465214aa93c3cb;p=blank.git diff --git a/src/app/FPSController.cpp b/src/app/FPSController.cpp index 9c7820c..87591aa 100644 --- a/src/app/FPSController.cpp +++ b/src/app/FPSController.cpp @@ -10,7 +10,11 @@ FPSController::FPSController(Entity &entity) noexcept : entity(entity) , pitch(0) , yaw(0) { + entity.Ref(); +} +FPSController::~FPSController() { + entity.UnRef(); } @@ -42,7 +46,7 @@ void FPSController::RotateYaw(float delta) noexcept { void FPSController::Update(int dt) noexcept { - entity.Rotation(glm::eulerAngleYX(yaw, pitch)); + entity.Orientation(glm::quat(glm::vec3(pitch, yaw, 0.0f))); entity.Velocity(glm::rotateY(velocity, yaw)); }