+LookAroundGoal::LookAroundGoal(Creature &c)
+: Goal(c)
+, timer(0.0) {
+}
+
+LookAroundGoal::~LookAroundGoal() {
+}
+
+std::string LookAroundGoal::Describe() const {
+ return "look around";
+}
+
+void LookAroundGoal::Enable() {
+ GetSteering().Halt();
+}
+
+void LookAroundGoal::Tick(double dt) {
+ timer -= dt;
+}
+
+void LookAroundGoal::Action() {
+ if (timer < 0.0) {
+ PickDirection();
+ timer = 1.0 + (Random().UNorm() * 4.0);
+ }
+}
+
+void LookAroundGoal::OnBackground() {
+ SetComplete();
+}
+
+void LookAroundGoal::PickDirection() noexcept {
+ double r = Random().SNorm();
+ r *= std::abs(r) * 0.5 * PI;
+ GetCreature().HeadingTarget(glm::rotate(GetSituation().Heading(), r, GetSituation().SurfaceNormal()));
+}
+
+