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))
59 glm::angleAxis(
m_nav.
yaw, glm::vec3(0.0F, 1.0F, 0.0F))
60 * glm::angleAxis(-
m_nav.
pitch, glm::vec3(1.0F, 0.0F, 0.0F)));
67 proc->set_view_transform(
m_view);
const std::optional< glm::vec3 > & position() const
Return the current position, if set.
void set_orientation(const glm::quat &q)
Set the orientation.
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
bool attached() const
True while a buffer is attached.
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: push the current view to every view target, then run the inherited influence path.
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 build_view_transform(const NavigationState &st, float aspect)
Build a ViewTransform from the current NavigationState without mutating it.
ViewTransform compute_view_transform(NavigationState &st, float aspect)
Compute a ViewTransform from the current NavigationState.
Tuning parameters for a first-person fly-navigation controller.
float pitch
Radians, vertical rotation, clamped to [-89, +89] degrees.
float yaw
Radians, horizontal rotation.
Data passed to an Emitter or Agent influence function on each commit.
Data passed to a Sensor or Agent perception function on each commit.