Monado OpenXR Runtime
Macros | Functions
oxr_input.c File Reference

Holds input related functions. More...

#include "util/u_debug.h"
#include "util/u_time.h"
#include "util/u_misc.h"
#include "xrt/xrt_compiler.h"
#include "oxr_objects.h"
#include "oxr_logger.h"
#include "oxr_handle.h"
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <assert.h>
Include dependency graph for oxr_input.c:

Macros

#define BOOL_CHECK(NAME)
 
#define VEC1_CHECK(NAME)
 
#define VEC2_CHECK(NAME)
 
#define OXR_ACTION_GET_FILLER(TYPE)
 

Functions

XrResult oxr_action_set_create (struct oxr_logger *log, struct oxr_instance *inst, const XrActionSetCreateInfo *createInfo, struct oxr_action_set **out_act_set)
 
XrResult oxr_action_create (struct oxr_logger *log, struct oxr_action_set *act_set, const XrActionCreateInfo *createInfo, struct oxr_action **out_act)
 
void oxr_classify_sub_action_paths (struct oxr_logger *log, struct oxr_instance *inst, uint32_t num_subaction_paths, const XrPath *subaction_paths, struct oxr_sub_paths *sub_paths)
 Helper function to classify sub_paths. More...
 
XrResult oxr_source_get_pose_input (struct oxr_logger *log, struct oxr_session *sess, uint32_t act_key, const struct oxr_sub_paths *sub_paths, struct oxr_source_input **out_input)
 Find the pose input for the set of sub_paths. More...
 
XrResult oxr_session_attach_action_sets (struct oxr_logger *log, struct oxr_session *sess, const XrSessionActionSetsAttachInfo *bindInfo)
 
XrResult oxr_action_sync_data (struct oxr_logger *log, struct oxr_session *sess, uint32_t countActionSets, const XrActiveActionSet *actionSets)
 
XrResult oxr_action_get_boolean (struct oxr_logger *log, struct oxr_session *sess, uint64_t key, struct oxr_sub_paths sub_paths, XrActionStateBoolean *data)
 
XrResult oxr_action_get_vector1f (struct oxr_logger *log, struct oxr_session *sess, uint64_t key, struct oxr_sub_paths sub_paths, XrActionStateFloat *data)
 
XrResult oxr_action_get_vector2f (struct oxr_logger *log, struct oxr_session *sess, uint64_t key, struct oxr_sub_paths sub_paths, XrActionStateVector2f *data)
 
XrResult oxr_action_get_pose (struct oxr_logger *log, struct oxr_session *sess, uint64_t key, struct oxr_sub_paths sub_paths, XrActionStatePose *data)
 
XrResult oxr_action_apply_haptic_feedback (struct oxr_logger *log, struct oxr_session *sess, uint64_t key, struct oxr_sub_paths sub_paths, const XrHapticBaseHeader *hapticEvent)
 
XrResult oxr_action_stop_haptic_feedback (struct oxr_logger *log, struct oxr_session *sess, uint64_t key, struct oxr_sub_paths sub_paths)
 

Detailed Description

Holds input related functions.

Author
Jakob Bornecrantz jakob.nosp@m.@col.nosp@m.labor.nosp@m.a.co.nosp@m.m

Macro Definition Documentation

◆ BOOL_CHECK

#define BOOL_CHECK (   NAME)
Value:
if (src->NAME.current.active) { \
active |= true; \
value |= src->NAME.current.boolean; \
timestamp = src->NAME.current.timestamp; \
}

◆ OXR_ACTION_GET_FILLER

#define OXR_ACTION_GET_FILLER (   TYPE)
Value:
if (sub_paths.any && src->any_state.active) { \
get_state_from_state_##TYPE(&src->any_state, data); \
} \
if (sub_paths.user && src->user.current.active) { \
get_state_from_state_##TYPE(&src->user.current, data); \
} \
if (sub_paths.head && src->head.current.active) { \
get_state_from_state_##TYPE(&src->head.current, data); \
} \
if (sub_paths.left && src->left.current.active) { \
get_state_from_state_##TYPE(&src->left.current, data); \
} \
if (sub_paths.right && src->right.current.active) { \
get_state_from_state_##TYPE(&src->right.current, data); \
} \
if (sub_paths.gamepad && src->gamepad.current.active) { \
get_state_from_state_##TYPE(&src->gamepad.current, data); \
}

◆ VEC1_CHECK

#define VEC1_CHECK (   NAME)
Value:
if (src->NAME.current.active) { \
active |= true; \
if (value < src->NAME.current.vec1.x) { \
value = src->NAME.current.vec1.x; \
timestamp = src->NAME.current.timestamp; \
} \
}

◆ VEC2_CHECK

#define VEC2_CHECK (   NAME)
Value:
if (src->NAME.current.active) { \
active |= true; \
float curr_x = src->NAME.current.vec2.x; \
float curr_y = src->NAME.current.vec2.y; \
float curr_d = curr_x * curr_x + curr_y * curr_y; \
if (distance < curr_d) { \
x = curr_x; \
y = curr_y; \
distance = curr_d; \
timestamp = src->NAME.current.timestamp; \
} \
}