Kore 3
Loading...
Searching...
No Matches
vr.h
1#ifndef KORE_VR_HEADER
2#define KORE_VR_HEADER
3
4#include <kore3/global.h>
5
6#include <kore3/math/matrix.h>
8#include <kore3/math/vector.h>
9
13
14#ifdef KORE_VR
15
16#ifdef __cplusplus
17extern "C" {
18#endif
19
20typedef enum { KORE_TRACKING_ORIGIN_STAND, KORE_TRACKING_ORIGIN_SIT } kore_tracking_origin;
21
22typedef enum { KORE_TRACKED_DEVICE_HMD, KORE_TRACKED_DEVICE_CONTROLLER, KORE_TRACKED_DEVICE_VIVE_TRACKER } kore_tracked_device;
23
24typedef struct kore_vr_pose {
25 kore_quaternion orientation;
26 kore_float3 position;
27
28 kore_matrix4x4 eye;
29 kore_matrix4x4 projection;
30
31 // fov
32 float left;
33 float right;
34 float bottom;
35 float top;
36} kore_vr_pose;
37
38typedef struct kore_vr_pose_state {
39 kore_vr_pose vrPose;
40 kore_float3 angularVelocity; // Angular velocity in radians per second
41 kore_float3 linearVelocity; // Velocity in meters per second
42 kore_float3 angularAcceleration; // Angular acceleration in radians per second per second
43 kore_float3 linearAcceleration; // Acceleration in meters per second per second
44
45 kore_tracked_device_t trackedDevice;
46
47 // Sensor status
48 bool isVisible;
49 bool hmdPresenting;
50 bool hmdMounted;
51 bool displayLost;
52 bool shouldQuit;
53 bool shouldRecenter;
54} kore_vr_pose_state;
55
56typedef struct kore_vr_sensor_state {
57 kore_vr_pose_state pose;
58} kore_vr_sensor_state;
59
60void *kore_vr_init(void *hinst, const char *title, const char *windowClassName);
61void kore_vr_begin();
62void kore_vr_begin_render(int eye);
63void kore_vr_end_render(int eye);
64kore_vr_sensor_state kore_vr_get_sensor_state(int eye);
65kore_vr_pose_state kore_vr_get_controller(int index);
66void kore_vr_warp_swap();
67void kore_vr_update_tracking_origin(kore_tracking_origin origin);
68void kore_vr_reset_hmd_pose();
69void kore_vr_ovr_shutdown();
70
71#ifdef __cplusplus
72}
73#endif
74
75#endif
76
77#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.