]> git.localhorst.tv Git - blank.git/blobdiff - src/world/EntityController.hpp
experiments with ai states and steering
[blank.git] / src / world / EntityController.hpp
index 526a3222fa4d985fc53094ab7e2c649376dfdd2e..3bfc10bb47b5a4118a587a7a3d8fe1908f78fb20 100644 (file)
@@ -35,6 +35,13 @@ struct EntityController {
        ) noexcept {
                return (target - state.velocity) * n;
        }
+       /// give a force that makes state come to a halt over 1/n seconds
+       static inline glm::vec3 Halt(
+               const EntityState &state,
+               float n
+       ) noexcept {
+               return state.velocity * -n;
+       }
 
 };