92 std::string influence_fn_name,
InfluenceFn influence,
93 std::string radiate_fn_name,
RadiateFn radiate);
114 return m_falloff_radius > 0.0F ? m_falloff_radius : query_radius();
130 [[nodiscard]]
const std::string&
radiate_fn_name()
const {
return m_radiate_fn_name; }
141 [[nodiscard]]
const std::vector<std::pair<uint32_t, float>>&
neighbors()
const
147 void set_falloff_curve(FalloffCurve curve);
150 [[nodiscard]] std::optional<FalloffCurve>
falloff_curve()
const {
return m_falloff_curve; }
161 float m_falloff_radius { 0.0F };
166 std::optional<FalloffCurve> m_falloff_curve { FalloffCurve::Linear };
std::function< void(const PerceptionContext &)> PerceptionFn
std::function< void(const InfluenceContext &)> InfluenceFn
Object that both perceives nearby entities and acts on MayaFlux objects.
std::vector< std::pair< uint32_t, float > > m_neighbors
std::function< float(float)> FalloffFn
Falloff curve mapping normalized distance to weight.
void set_radiate_fn_name(std::string name)
Set or replace the radiate callable identifier.
std::string m_radiate_fn_name
void set_radiate(RadiateFn fn)
Replace the per-neighbor radiation callable.
const std::string & radiate_fn_name() const
Identifier for the radiate callable, empty if anonymous.
float falloff_radius() const
Current falloff radius, or the query radius if none was set.
std::optional< FalloffCurve > falloff_curve() const
Current named curve, or nullopt if a custom lambda was set via set_falloff().
FalloffCurve
Built-in falloff curves that survive state encode/decode.
void set_falloff_radius(float r)
Set the falloff radius, the distance over which the weight decays.
void set_falloff(FalloffFn fn)
Replace the falloff curve.
const std::vector< std::pair< uint32_t, float > > & neighbors() const
Neighbors captured on the most recent perception, with weights.
std::function< void(uint32_t id, float weight)> RadiateFn
Per-neighbor radiation callable.
Agent that affects its surroundings by being there.
Data passed to an Emitter or Agent influence function on each commit.
Data passed to a Sensor or Agent perception function on each commit.