fix build with latest PCVR branch

moved some common functions inside the gzdoom branch since they are used with OpenVR as well
This commit is contained in:
Emanuele Disco 2024-02-26 15:04:51 +09:00
parent 7b0adaad6c
commit 9bed866c5f
3 changed files with 0 additions and 36 deletions

View file

@ -45,7 +45,6 @@ bool resetDoomYaw;
bool resetPreviousPitch;
float doomYaw;
float previousPitch;
float vrFOV;
vec3_t worldPosition;
vec3_t hmdPosition;
vec3_t hmdorientation;

View file

@ -48,8 +48,6 @@ extern float doomYaw;
extern bool resetPreviousPitch;
extern float previousPitch;
extern float vrFOV;
extern vec3_t worldPosition;
extern vec3_t hmdPosition;

View file

@ -62,37 +62,4 @@ void rotateAboutOrigin(float v1, float v2, float rotation, vec2_t out)
out[1] = v[1];
}
float length(float x, float y)
{
return sqrtf(powf(x, 2.0f) + powf(y, 2.0f));
}
#define NLF_DEADZONE 0.1
#define NLF_POWER 2.2
float nonLinearFilter(float in)
{
float val = 0.0f;
if (in > NLF_DEADZONE)
{
val = in > 1.0f ? 1.0f : in;
val -= NLF_DEADZONE;
val /= (1.0f - NLF_DEADZONE);
val = powf(val, NLF_POWER);
}
else if (in < -NLF_DEADZONE)
{
val = in < -1.0f ? -1.0f : in;
val += NLF_DEADZONE;
val /= (1.0f - NLF_DEADZONE);
val = -powf(fabsf(val), NLF_POWER);
}
return val;
}
bool between(float min, float val, float max)
{
return (min < val) && (val < max);
}