Monado OpenXR Runtime
qwerty_device.c File Reference

Implementation of qwerty_device related methods. More...

#include "xrt/xrt_device.h"
#include "math/m_api.h"
#include "math/m_space.h"
#include "math/m_mathinclude.h"
#include "util/u_device.h"
#include "util/u_distortion_mesh.h"
#include "util/u_var.h"
#include "util/u_logging.h"
#include "util/u_time.h"
#include "util/u_misc.h"
#include "os/os_time.h"
#include "qwerty_device.h"
#include <stdio.h>
#include <assert.h>
Include dependency graph for qwerty_device.c:

Macros

#define QWERTY_HMD_INITIAL_MOVEMENT_SPEED   0.002f
 
#define QWERTY_HMD_INITIAL_LOOK_SPEED   0.02f
 
#define QWERTY_CONTROLLER_INITIAL_MOVEMENT_SPEED   0.005f
 
#define QWERTY_CONTROLLER_INITIAL_LOOK_SPEED   0.05f
 
#define MOVEMENT_SPEED_STEP   1.25f
 
#define SPRINT_STEPS   5
 
#define QWERTY_HMD_INITIAL_POS   (struct xrt_vec3){0, 1.6f, 0}
 
#define QWERTY_CONTROLLER_INITIAL_POS(is_left)   (struct xrt_vec3){(is_left) ? -0.2f : 0.2f, -0.3f, -0.5f}
 
#define QWERTY_SELECT   0
 
#define QWERTY_MENU   1
 
#define QWERTY_GRIP   2
 
#define QWERTY_AIM   3
 
#define QWERTY_VIBRATION   0
 
#define QWERTY_TRACE(qd, ...)   U_LOG_XDEV_IFL_T(&qd->base, qd->sys->log_level, __VA_ARGS__)
 
#define QWERTY_DEBUG(qd, ...)   U_LOG_XDEV_IFL_D(&qd->base, qd->sys->log_level, __VA_ARGS__)
 
#define QWERTY_INFO(qd, ...)   U_LOG_XDEV_IFL_I(&qd->base, qd->sys->log_level, __VA_ARGS__)
 
#define QWERTY_WARN(qd, ...)   U_LOG_XDEV_IFL_W(&qd->base, qd->sys->log_level, __VA_ARGS__)
 
#define QWERTY_ERROR(qd, ...)   U_LOG_XDEV_IFL_E(&qd->base, qd->sys->log_level, __VA_ARGS__)
 

Functions

static void qwerty_system_remove (struct qwerty_system *qs, struct qwerty_device *qd)
 
static void qwerty_system_destroy (struct qwerty_system *qs)
 
static bool eq (void *a, void *b)
 
struct qwerty_deviceqwerty_device (struct xrt_device *xd)
 
struct qwerty_hmdqwerty_hmd (struct xrt_device *xd)
 
struct qwerty_controllerqwerty_controller (struct xrt_device *xd)
 
static xrt_result_t qwerty_update_inputs (struct xrt_device *xd)
 
static void qwerty_set_output (struct xrt_device *xd, enum xrt_output_name name, const union xrt_output_value *value)
 
static void qwerty_get_tracked_pose (struct xrt_device *xd, enum xrt_input_name name, int64_t at_timestamp_ns, struct xrt_space_relation *out_relation)
 
static void qwerty_destroy (struct xrt_device *xd)
 
struct qwerty_hmdqwerty_hmd_create (void)
 
struct qwerty_controllerqwerty_controller_create (bool is_left, struct qwerty_hmd *qhmd)
 
static void qwerty_setup_var_tracking (struct qwerty_system *qs)
 
struct qwerty_systemqwerty_system_create (struct qwerty_hmd *qhmd, struct qwerty_controller *qleft, struct qwerty_controller *qright, enum u_logging_level log_level)
 
void qwerty_press_left (struct qwerty_device *qd)
 
void qwerty_release_left (struct qwerty_device *qd)
 
void qwerty_press_right (struct qwerty_device *qd)
 
void qwerty_release_right (struct qwerty_device *qd)
 
void qwerty_press_forward (struct qwerty_device *qd)
 
void qwerty_release_forward (struct qwerty_device *qd)
 
void qwerty_press_backward (struct qwerty_device *qd)
 
void qwerty_release_backward (struct qwerty_device *qd)
 
void qwerty_press_up (struct qwerty_device *qd)
 
void qwerty_release_up (struct qwerty_device *qd)
 
void qwerty_press_down (struct qwerty_device *qd)
 
void qwerty_release_down (struct qwerty_device *qd)
 
void qwerty_press_look_left (struct qwerty_device *qd)
 
void qwerty_release_look_left (struct qwerty_device *qd)
 
void qwerty_press_look_right (struct qwerty_device *qd)
 
void qwerty_release_look_right (struct qwerty_device *qd)
 
void qwerty_press_look_up (struct qwerty_device *qd)
 
void qwerty_release_look_up (struct qwerty_device *qd)
 
void qwerty_press_look_down (struct qwerty_device *qd)
 
void qwerty_release_look_down (struct qwerty_device *qd)
 
void qwerty_press_sprint (struct qwerty_device *qd)
 
void qwerty_release_sprint (struct qwerty_device *qd)
 
void qwerty_add_look_delta (struct qwerty_device *qd, float yaw, float pitch)
 
void qwerty_change_movement_speed (struct qwerty_device *qd, float steps)
 
void qwerty_release_all (struct qwerty_device *qd)
 
void qwerty_press_select (struct qwerty_controller *qc)
 
void qwerty_release_select (struct qwerty_controller *qc)
 
void qwerty_press_menu (struct qwerty_controller *qc)
 
void qwerty_release_menu (struct qwerty_controller *qc)
 
void qwerty_follow_hmd (struct qwerty_controller *qc, bool follow)
 
void qwerty_reset_controller_pose (struct qwerty_controller *qc)
 

Detailed Description

Implementation of qwerty_device related methods.

Author
Mateo de Mayo mateo.nosp@m.dema.nosp@m.yo@gm.nosp@m.ail..nosp@m.com

Function Documentation

◆ qwerty_controller_create()

struct qwerty_controller * qwerty_controller_create ( bool  is_left,
struct qwerty_hmd qhmd 
)

<

Todo:
: aim input not implemented