+ /// give a force that makes state go after target with an attempted
+ /// acceleration over 1/n seconds and a speed of s
+ static inline glm::vec3 Seek(
+ const EntityState &state,
+ const EntityState &target,
+ float s,
+ float n
+ ) noexcept {
+ return TargetVelocity(normalize(target.Diff(state)) * s, state, n);
+ }
+ /// opposite of seek
+ static inline glm::vec3 Flee(
+ const EntityState &state,
+ const EntityState &target,
+ float s,
+ float n
+ ) noexcept {
+ return TargetVelocity(normalize(state.Diff(target)) * s, state, n);
+ }