guillaume 2026.6.1
A C++ UI framework designed for modern desktop and extended reality (XR) applications.
Loading...
Searching...
No Matches
guillaume::components::HandPokeInteraction Class Reference

Whether an XR hand pokes an entity (touches it with a finger), and what to call when it does. More...

#include <headers/guillaume/components/hand_poke_interaction.hpp>

Inheritance diagram for guillaume::components::HandPokeInteraction:
Collaboration diagram for guillaume::components::HandPokeInteraction:

Public Member Functions

 HandPokeInteraction (void)
 Construct a component that is not poked and has no handler.
 ~HandPokeInteraction (void)=default
 Default destructor.
bool isPoke (void) const
 Check whether a hand pokes the entity.
void setPoking (bool poking)
 Record whether a hand pokes the entity.

Detailed Description

Whether an XR hand pokes an entity (touches it with a finger), and what to call when it does.

systems::HandPoke writes it in the Event phase. On each hand poke event it casts a ray from the poke pose along its forward direction and tests it against the entity's Transform and Bound: the poke flag becomes the result of that test, and the handler set with setOnEventHandler() is called when the ray hits. systems::Focus reads the flag to give the focus to the entity and systems::StyleState reads it as "pressed".

The handler runs for every poke event that hits the entity, not only for the first one. The flag only changes in a frame that received a poke event.

See also
systems::HandPoke, Interaction, HandPinchInteraction

Definition at line 47 of file hand_poke_interaction.hpp.

Constructor & Destructor Documentation

◆ HandPokeInteraction()

guillaume::components::HandPokeInteraction::HandPokeInteraction ( void )

Construct a component that is not poked and has no handler.

Definition at line 27 of file hand_poke_interaction.cpp.

Member Function Documentation

◆ isPoke()

bool guillaume::components::HandPokeInteraction::isPoke ( void ) const

Check whether a hand pokes the entity.

Returns
True when the ray of the last poke event hit the entity.

Definition at line 33 of file hand_poke_interaction.cpp.

◆ setPoking()

void guillaume::components::HandPokeInteraction::setPoking ( bool poking)

Record whether a hand pokes the entity.

Called by systems::HandPoke; it calls no handler. Always marks the component changed, even when the flag is the same.

Parameters
pokingTrue when the ray of the poke event hits the entity.

Definition at line 38 of file hand_poke_interaction.cpp.


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