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

Whether an XR hand pinches while pointing at an entity, and what to call when it does. More...

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

Inheritance diagram for guillaume::components::HandPinchInteraction:
Collaboration diagram for guillaume::components::HandPinchInteraction:

Public Member Functions

 HandPinchInteraction (void)
 Construct a component that is not pinched and has no handler.
 ~HandPinchInteraction (void)=default
 Default destructor.
bool isPinch (void) const
 Check whether a hand pinches the entity.
void setPinching (bool pinching)
 Record whether a hand pinches the entity.

Detailed Description

Whether an XR hand pinches while pointing at an entity, and what to call when it does.

systems::HandPinch writes it in the Event phase. On each hand pinch event it casts a ray from the hand pose along its forward direction and tests it against the entity's Transform and Bound: the pinch 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 pinch event that hits the entity, not only for the first one. The flag only changes in a frame that received a pinch event.

See also
systems::HandPinch, Interaction, HandPokeInteraction

Definition at line 48 of file hand_pinch_interaction.hpp.

Constructor & Destructor Documentation

◆ HandPinchInteraction()

guillaume::components::HandPinchInteraction::HandPinchInteraction ( void )

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

Definition at line 28 of file hand_pinch_interaction.cpp.

Member Function Documentation

◆ isPinch()

bool guillaume::components::HandPinchInteraction::isPinch ( void ) const

Check whether a hand pinches the entity.

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

Definition at line 34 of file hand_pinch_interaction.cpp.

◆ setPinching()

void guillaume::components::HandPinchInteraction::setPinching ( bool pinching)

Record whether a hand pinches the entity.

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

Parameters
pinchingTrue when the ray of the pinch event hits the entity.

Definition at line 39 of file hand_pinch_interaction.cpp.


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