Kore
Loading...
Searching...
No Matches
vrinterface.h
Go to the documentation of this file.
1#pragma once
2
3#include <kinc/global.h>
4
5#include <kinc/math/matrix.h>
7#include <kinc/math/vector.h>
8
12
13#ifdef KINC_VR
14
15#ifdef __cplusplus
16extern "C" {
17#endif
18
19typedef enum { KINC_TRACKING_ORIGIN_STAND, KINC_TRACKING_ORIGIN_SIT } kinc_tracking_origin_t;
20
21typedef enum { KINC_TRACKED_DEVICE_HMD, KINC_TRACKED_DEVICE_CONTROLLER, KINC_TRACKED_DEVICE_VIVE_TRACKER } kinc_tracked_device_t;
22
23typedef struct kinc_vr_pose {
24 kinc_quaternion_t orientation;
25 kinc_vector3_t position;
26
27 kinc_matrix4x4_t eye;
28 kinc_matrix4x4_t projection;
29
30 // fov
31 float left;
32 float right;
33 float bottom;
34 float top;
35} kinc_vr_pose_t;
36
37typedef struct kinc_vr_pose_state {
38 kinc_vr_pose_t vrPose;
39 kinc_vector3_t angularVelocity; // Angular velocity in radians per second
40 kinc_vector3_t linearVelocity; // Velocity in meters per second
41 kinc_vector3_t angularAcceleration; // Angular acceleration in radians per second per second
42 kinc_vector3_t linearAcceleration; // Acceleration in meters per second per second
43
44 kinc_tracked_device_t trackedDevice;
45
46 // Sensor status
47 bool isVisible;
48 bool hmdPresenting;
49 bool hmdMounted;
50 bool displayLost;
51 bool shouldQuit;
52 bool shouldRecenter;
53} kinc_vr_pose_state_t;
54
55typedef struct kinc_vr_sensor_state {
56 kinc_vr_pose_state_t pose;
57} kinc_vr_sensor_state_t;
58
59void *kinc_vr_interface_init(void *hinst, const char *title, const char *windowClassName);
60void kinc_vr_interface_begin();
61void kinc_vr_interface_begin_render(int eye);
62void kinc_vr_interface_end_render(int eye);
63kinc_vr_sensor_state_t kinc_vr_interface_get_sensor_state(int eye);
64kinc_vr_pose_state_t kinc_vr_interface_get_controller(int index);
65void kinc_vr_interface_warp_swap();
66void kinc_vr_interface_update_tracking_origin(kinc_tracking_origin_t origin);
67void kinc_vr_interface_reset_hmd_pose();
68void kinc_vr_interface_ovr_shutdown();
69
70#ifdef __cplusplus
71}
72#endif
73
74#endif
Provides basic functionality that's used all over the place. There's usually no need to manually incl...
Provides basic matrix types and a few functions which create transformation-matrices....
Provides a basic quaternion type.
Provides basic vector types.