2016-08-11 04:17:14 +00:00
|
|
|
#ifndef LOVR_HEADSET_TYPES
|
2016-09-17 04:37:30 +00:00
|
|
|
#define LOVR_HEADSET_TYPES
|
2016-08-11 04:17:14 +00:00
|
|
|
typedef void (*headsetRenderCallback)(int eyeIndex, void* userdata);
|
2016-09-16 06:57:01 +00:00
|
|
|
|
2016-10-03 01:09:33 +00:00
|
|
|
typedef enum {
|
|
|
|
CONTROLLER_HAND_LEFT,
|
|
|
|
CONTROLLER_HAND_RIGHT
|
|
|
|
} ControllerHand;
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
ControllerHand hand;
|
|
|
|
} Controller;
|
|
|
|
|
2016-09-17 04:37:30 +00:00
|
|
|
typedef struct {
|
2016-10-03 18:40:20 +00:00
|
|
|
char (*isPresent)(void* headset);
|
2016-10-01 21:12:55 +00:00
|
|
|
const char* (*getType)(void* headset);
|
2016-10-24 23:03:29 +00:00
|
|
|
void (*getDisplayDimensions)(void* headset, int* width, int* height);
|
2016-09-27 06:48:09 +00:00
|
|
|
void (*getClipDistance)(void* headset, float* near, float* far);
|
2016-10-01 21:12:55 +00:00
|
|
|
void (*setClipDistance)(void* headset, float near, float far);
|
2016-10-01 21:17:26 +00:00
|
|
|
void (*getTrackingSize)(void* headset, float* width, float* depth);
|
2016-10-01 22:11:45 +00:00
|
|
|
char (*isBoundsVisible)(void* headset);
|
|
|
|
void (*setBoundsVisible)(void* headset, char visible);
|
2016-09-17 21:25:08 +00:00
|
|
|
void (*getPosition)(void* headset, float* x, float* y, float* z);
|
2016-10-04 00:02:01 +00:00
|
|
|
void (*getOrientation)(void* headset, float* w, float* x, float* y, float* z);
|
2016-09-17 04:37:30 +00:00
|
|
|
void (*getVelocity)(void* headset, float* x, float* y, float* z);
|
2016-10-01 21:12:55 +00:00
|
|
|
void (*getAngularVelocity)(void* headset, float* x, float* y, float* z);
|
2016-10-03 01:09:33 +00:00
|
|
|
Controller* (*getController)(void* headset, ControllerHand hand);
|
2016-10-03 18:12:06 +00:00
|
|
|
char (*isControllerPresent)(void* headset, Controller* controller);
|
2016-10-03 18:12:21 +00:00
|
|
|
void (*getControllerPosition)(void* headset, Controller* controller, float* x, float* y, float* z);
|
2016-10-03 18:16:48 +00:00
|
|
|
void (*getControllerOrientation)(void* headset, Controller* controller, float* w, float* x, float* y, float* z);
|
2016-11-12 11:44:33 +00:00
|
|
|
float (*getControllerAxis)(void* headset, Controller* controller);
|
2016-10-24 22:52:16 +00:00
|
|
|
ControllerHand (*getControllerHand)(void* headset, Controller* controller);
|
2016-09-17 04:37:30 +00:00
|
|
|
void (*renderTo)(void* headset, headsetRenderCallback callback, void* userdata);
|
|
|
|
} HeadsetInterface;
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
void* state;
|
|
|
|
HeadsetInterface* interface;
|
|
|
|
} Headset;
|
2016-08-11 04:17:14 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
void lovrHeadsetInit();
|
2016-10-03 18:40:20 +00:00
|
|
|
char lovrHeadsetIsPresent();
|
2016-10-01 21:12:55 +00:00
|
|
|
const char* lovrHeadsetGetType();
|
2016-10-24 23:03:29 +00:00
|
|
|
void lovrHeadsetGetDisplayDimensions(int* width, int* height);
|
2016-09-27 06:48:09 +00:00
|
|
|
void lovrHeadsetGetClipDistance(float* near, float* far);
|
2016-10-01 21:12:55 +00:00
|
|
|
void lovrHeadsetSetClipDistance(float near, float far);
|
2016-10-01 21:17:26 +00:00
|
|
|
void lovrHeadsetGetTrackingSize(float* width, float* depth);
|
2016-10-01 22:11:45 +00:00
|
|
|
char lovrHeadsetIsBoundsVisible();
|
|
|
|
void lovrHeadsetSetBoundsVisible(char isVisible);
|
2016-09-17 21:25:08 +00:00
|
|
|
void lovrHeadsetGetPosition(float* x, float* y, float* z);
|
2016-10-04 00:02:01 +00:00
|
|
|
void lovrHeadsetGetOrientation(float* w, float* x, float* y, float* z);
|
2016-09-17 02:43:43 +00:00
|
|
|
void lovrHeadsetGetVelocity(float* x, float* y, float* z);
|
2016-10-01 21:12:55 +00:00
|
|
|
void lovrHeadsetGetAngularVelocity(float* x, float* y, float* z);
|
2016-10-03 01:09:33 +00:00
|
|
|
Controller* lovrHeadsetGetController(ControllerHand hand);
|
2016-10-03 18:12:06 +00:00
|
|
|
char lovrHeadsetIsControllerPresent(Controller* controller);
|
2016-10-03 18:12:21 +00:00
|
|
|
void lovrHeadsetGetControllerPosition(Controller* controller, float* x, float* y, float* z);
|
2016-10-03 18:16:48 +00:00
|
|
|
void lovrHeadsetGetControllerOrientation(Controller* controller, float* w, float* x, float* y, float* z);
|
2016-11-12 11:44:33 +00:00
|
|
|
float lovrHeadsetGetControllerAxis(Controller* controller);
|
2016-10-24 22:52:16 +00:00
|
|
|
ControllerHand lovrHeadsetGetControllerHand(Controller* controller);
|
2016-09-14 00:02:23 +00:00
|
|
|
void lovrHeadsetRenderTo(headsetRenderCallback callback, void* userdata);
|