X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fworld%2FEntityController.hpp;fp=src%2Fworld%2FEntityController.hpp;h=3bfc10bb47b5a4118a587a7a3d8fe1908f78fb20;hb=f0a20986c573c4df1eb1212333489252c4b30efa;hp=526a3222fa4d985fc53094ab7e2c649376dfdd2e;hpb=0ab149c70b3f984b2cc0c7a122b4aa347bc5fd79;p=blank.git diff --git a/src/world/EntityController.hpp b/src/world/EntityController.hpp index 526a322..3bfc10b 100644 --- a/src/world/EntityController.hpp +++ b/src/world/EntityController.hpp @@ -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; + } };