Program Listing for File arrival_force.hpp

Return to documentation for file (cosm/apf2D/nav/arrival_force.hpp)

#pragma once

/*******************************************************************************
 * Includes
 ******************************************************************************/
#include "rcppsw/er/client.hpp"
#include "rcppsw/rcppsw.hpp"

#include "cosm/cosm.hpp"
#include "cosm/apf2D/boid.hpp"
#include "cosm/apf2D/base_force.hpp"

/*******************************************************************************
 * Namespaces/Decls
 ******************************************************************************/
namespace cosm::apf2D::nav {

namespace config {
struct arrival_force_config;
} /* namespace config */

/*******************************************************************************
 * Class Definitions
 ******************************************************************************/
class arrival_force : public rer::client<arrival_force>,
                      public capf2D::base_force {
 public:
  explicit arrival_force(const config::arrival_force_config* config);

  rmath::vector2d operator()(const boid& entity, const rmath::vector2d& target);
  bool within_slowing_radius(void) const { return m_within_slowing_radius; }

 private:
  /* clang-format off */
  const double mc_max;
  const double mc_slowing_speed_min;
  const double mc_slowing_radius;

  bool         m_within_slowing_radius{false};
  /* clang-format on */
};

} /* namespace cosm::apf2D::nav */