|
guillaume 2026.6.1
A C++ UI framework designed for modern desktop and extended reality (XR) applications.
|
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>


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. | |
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.
Definition at line 48 of file hand_pinch_interaction.hpp.
| 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.
| bool guillaume::components::HandPinchInteraction::isPinch | ( | void | ) | const |
Check whether a hand pinches the entity.
Definition at line 34 of file hand_pinch_interaction.cpp.
| 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.
| pinching | True when the ray of the pinch event hits the entity. |
Definition at line 39 of file hand_pinch_interaction.cpp.