11 :
Agent(query_radius,
std::move(perception),
std::move(influence))
12 , m_nav(Kinesis::make_navigation_state(config))
21 std::string influence_fn_name,
InfluenceFn influence)
23 std::move(perception_fn_name),
std::move(perception),
24 std::move(influence_fn_name),
std::move(influence))
25 , m_nav(Kinesis::make_navigation_state(config))
62 proc->set_view_transform(
m_view);
virtual void invoke_influence(const InfluenceContext &ctx) const
Invoke the influence function with the supplied context.
virtual void invoke_perception(const PerceptionContext &ctx)
Invoke the perception function with the supplied context.
std::function< void(const PerceptionContext &)> PerceptionFn
void set_position(const glm::vec3 &p)
Set the position, enabling spatial indexing and queries for this object.
std::function< void(const InfluenceContext &)> InfluenceFn
Object that both perceives nearby entities and acts on MayaFlux objects.
void invoke_influence(const InfluenceContext &ctx) const override
Influence: run the user influence callable, then push the current view to every view target.
void add_view_target(std::shared_ptr< Buffers::RenderProcessor > proc)
Add a render processor whose view transform this Locus drives.
Kinesis::NavigationState m_nav
Locus(const Kinesis::NavigationConfig &config, float query_radius, PerceptionFn perception, InfluenceFn influence)
Construct from a NavigationConfig with perception and influence functions.
std::vector< std::shared_ptr< Buffers::RenderProcessor > > m_view_targets
void invoke_perception(const PerceptionContext &ctx) override
Perceive: run the user perception callable, then integrate the view.
void remove_view_target(const std::shared_ptr< Buffers::RenderProcessor > &proc)
Stop driving a render processor's view transform.
Kinesis::ViewTransform m_view
void advance_navigation(NavigationState &st)
Advance eye position by held movement flags against elapsed time.
ViewTransform compute_view_transform(NavigationState &st, float aspect)
Compute a ViewTransform from the current NavigationState.
ViewTransform build_view_transform(const NavigationState &st, float aspect)
Build a ViewTransform from the current NavigationState without mutating it.
Tuning parameters for a first-person fly-navigation controller.
Data passed to an Emitter or Agent influence function on each commit.
Data passed to a Sensor or Agent perception function on each commit.