]> git.localhorst.tv Git - blank.git/blobdiff - src/app/FPSController.cpp
group entity updates in as few packets as possible
[blank.git] / src / app / FPSController.cpp
index 48e39dc8ba49bac7fc6071a9444da50a0bbed044..87591aa254b6d4764c3be09127e192af8234fad3 100644 (file)
@@ -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::quat(glm::vec3(pitch, yaw, 0.0f)));
+       entity.Orientation(glm::quat(glm::vec3(pitch, yaw, 0.0f)));
        entity.Velocity(glm::rotateY(velocity, yaw));
 }