rtcwquest/Projects/Android/jni/RTCWVR/VrCommon.h

80 lines
2 KiB
C
Raw Normal View History

2020-06-10 18:20:11 +00:00
#if !defined(vrcommon_h)
#define vrcommon_h
#include <VrApi_Input.h>
#include <android/log.h>
#include "mathlib.h"
#include "VrClientInfo.h"
2020-06-10 18:20:11 +00:00
#define LOG_TAG "RTCWVR"
2020-06-10 18:20:11 +00:00
#ifndef NDEBUG
#define DEBUG 1
#endif
#define ALOGE(...) __android_log_print( ANDROID_LOG_ERROR, LOG_TAG, __VA_ARGS__ )
#if DEBUG
#define ALOGV(...) __android_log_print( ANDROID_LOG_VERBOSE, LOG_TAG, __VA_ARGS__ )
#else
#define ALOGV(...)
#endif
qboolean rtcw_initialised;
2020-06-10 18:20:11 +00:00
long long global_time;
float playerHeight;
float playerYaw;
qboolean showingScreenLayer;
2020-06-10 18:20:11 +00:00
ovrTracking2 tracking;
2020-06-10 18:20:11 +00:00
#define DUCK_NOTDUCKED 0
#define DUCK_BUTTON 1
#define DUCK_CROUCHED 2
int ducked;
qboolean player_moving;
int resyncClientYawWithGameYaw;
2020-06-10 18:20:11 +00:00
vr_client_info_t vr;
2020-06-10 18:20:11 +00:00
float radians(float deg);
float degrees(float rad);
qboolean isMultiplayer();
double GetTimeInMilliSeconds();
float length(float x, float y);
float nonLinearFilter(float in);
qboolean between(float min, float val, float max);
2020-06-10 18:20:11 +00:00
void rotateAboutOrigin(float v1, float v2, float rotation, vec2_t out);
void QuatToYawPitchRoll(ovrQuatf q, vec3_t rotation, vec3_t out);
2020-06-10 18:20:11 +00:00
void handleTrackedControllerButton(ovrInputStateTrackedRemote * trackedRemoteState, ovrInputStateTrackedRemote * prevTrackedRemoteState, uint32_t button, int key);
void interactWithTouchScreen(ovrTracking *tracking, ovrInputStateTrackedRemote *newState, ovrInputStateTrackedRemote *oldState);
//Called from engine code
qboolean RTCWVR_useScreenLayer();
2020-07-01 22:49:41 +00:00
void RTCWVR_GetScreenRes(int *width, int *height);
void RTCWVR_Vibrate(float duration, int channel, float intensity );
qboolean RTCWVR_processMessageQueue();
void RTCWVR_FrameSetup();
void RTCWVR_setUseScreenLayer(qboolean use);
void RTCWVR_processHaptics();
void RTCWVR_getHMDOrientation();
void RTCWVR_getTrackedRemotesOrientation();
void RTCWVR_ResyncClientYawWithGameYaw();
void RTCWVR_incrementFrameIndex();
void RTCWVR_prepareEyeBuffer(int eye );
void RTCWVR_finishEyeBuffer(int eye );
void RTCWVR_submitFrame();
2020-06-10 18:20:11 +00:00
2020-07-01 22:49:41 +00:00
void GPUDropSync();
void GPUWaitSync();
2020-06-10 18:20:11 +00:00
#endif //vrcommon_h