2020-02-22 16:10:48 +00:00
|
|
|
#if !defined(vrcommon_h)
|
|
|
|
#define vrcommon_h
|
|
|
|
|
2020-02-29 16:47:46 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C"
|
|
|
|
{
|
|
|
|
#endif
|
|
|
|
|
|
|
|
//#include <VrApi_Ext.h>
|
2020-02-22 16:10:48 +00:00
|
|
|
#include <VrApi_Input.h>
|
|
|
|
|
|
|
|
#include <android/log.h>
|
|
|
|
|
|
|
|
#include "mathlib.h"
|
|
|
|
|
|
|
|
#define LOG_TAG "QzDoom"
|
|
|
|
|
|
|
|
#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
|
|
|
|
|
|
|
|
bool qzdoom_initialised;
|
|
|
|
|
|
|
|
long long global_time;
|
|
|
|
|
|
|
|
float playerHeight;
|
|
|
|
float playerYaw;
|
|
|
|
|
|
|
|
bool showingScreenLayer;
|
|
|
|
float vrFOV;
|
|
|
|
|
|
|
|
vec3_t worldPosition;
|
|
|
|
|
|
|
|
vec3_t hmdPosition;
|
|
|
|
vec3_t hmdorientation;
|
|
|
|
vec3_t positionDeltaThisFrame;
|
|
|
|
|
|
|
|
vec3_t weaponangles;
|
|
|
|
vec3_t weaponoffset;
|
|
|
|
|
|
|
|
vec3_t flashlightangles;
|
|
|
|
vec3_t flashlightoffset;
|
|
|
|
|
|
|
|
#define DUCK_NOTDUCKED 0
|
|
|
|
#define DUCK_BUTTON 1
|
|
|
|
#define DUCK_CROUCHED 2
|
|
|
|
int ducked;
|
|
|
|
|
|
|
|
bool player_moving;
|
|
|
|
|
2020-03-01 23:09:29 +00:00
|
|
|
void shutdownVR();
|
2020-02-22 16:10:48 +00:00
|
|
|
|
|
|
|
float radians(float deg);
|
|
|
|
float degrees(float rad);
|
|
|
|
bool isMultiplayer();
|
|
|
|
double GetTimeInMilliSeconds();
|
|
|
|
float length(float x, float y);
|
|
|
|
float nonLinearFilter(float in);
|
|
|
|
bool between(float min, float val, float max);
|
|
|
|
void rotateAboutOrigin(float v1, float v2, float rotation, vec2_t out);
|
|
|
|
void QuatToYawPitchRoll(ovrQuatf q, float pitchAdjust, vec3_t out);
|
|
|
|
bool useScreenLayer();
|
|
|
|
void handleTrackedControllerButton(ovrInputStateTrackedRemote * trackedRemoteState, ovrInputStateTrackedRemote * prevTrackedRemoteState, uint32_t button, int key);
|
2020-03-01 23:09:29 +00:00
|
|
|
void Android_GetScreenRes(uint32_t *width, uint32_t *height);
|
2020-02-22 16:10:48 +00:00
|
|
|
|
2020-02-29 16:47:46 +00:00
|
|
|
void setUseScreenLayer(bool use);
|
|
|
|
|
2020-03-01 23:09:29 +00:00
|
|
|
void processHaptics();
|
|
|
|
void getHMDOrientation(ovrTracking2 *tracking);
|
|
|
|
void getTrackedRemotesOrientation();
|
|
|
|
|
|
|
|
void incrementFrameIndex();
|
|
|
|
|
|
|
|
ovrSubmitFrameDescription2 setupFrameDescriptor(ovrTracking2 *tracking);
|
2020-02-29 16:47:46 +00:00
|
|
|
void prepareEyeBuffer(int eye );
|
|
|
|
void finishEyeBuffer(int eye );
|
2020-03-01 23:09:29 +00:00
|
|
|
void submitFrame(ovrSubmitFrameDescription2 *frameDesc);
|
2020-02-29 16:47:46 +00:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
} // extern "C"
|
|
|
|
#endif
|
|
|
|
|
2020-02-22 16:10:48 +00:00
|
|
|
#endif //vrcommon_h
|