guillaume 2026.6.1
A C++ UI framework designed for modern desktop and extended reality (XR) applications.
Loading...
Searching...
No Matches
guillaume::components::Interaction< EventType, HasFactory > Class Template Reference

Component that makes an entity react to one kind of input event (a hand pinch, a hand poke, a trigger pull, ...). More...

Detailed Description

template<typename EventType, bool HasFactory = HasFactoryType<EventType>>
class guillaume::components::Interaction< EventType, HasFactory >

Component that makes an entity react to one kind of input event (a hand pinch, a hand poke, a trigger pull, ...).

Each hand interaction component derives from it: HandPinchInteraction is Interaction<utility::event::HandPinchEvent>. The system of the same input (systems::HandPinch, ...) runs in the Event phase on the entities that have the component, a Transform and a Bound. systems::HandPinch and systems::HandPoke call the handler stored in InteractionBase; the other hand systems have no per-entity rule (see each derived component).

auto &pinch =
registry.addComponent<components::HandPinchInteraction>(identifier);
pinch.setOnEventHandler([] { openMenu(); });
Whether an XR hand pinches while pointing at an entity, and what to call when it does.

The component also derives from EventType, so it has the fields of that event, but no system of the library writes them: read the state from the accessors of the derived component instead (HandPinchInteraction::isPinch, HandPokeInteraction::isPoke).

Template Parameters
EventTypeThe event the component reacts to.
HasFactoryWhether EventType declares a nested Factory type. Deduced with HasFactoryType; leave it to its default.
See also
InteractionBase, HandPinchInteraction, HandPokeInteraction

Definition at line 115 of file interaction.hpp.


The documentation for this class was generated from the following file: